Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8556617
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T15:23:35+00:00 2026-06-11T15:23:35+00:00

This is a programming question on my homework for one of my courses. I

  • 0

This is a programming question on my homework for one of my courses. I haven’t programmed in a couple years and I wasn’t that great to begin with. I’m currently going through tutorials to get back up to speed, but it will take some time. If you guys can help me out with this problem, I would really appreciate it.

Constraints:

Each term of this sequence is a positive integer of the form 2^i*3^j*5^k, for all non-negative integers i, j, and k with
i + j + k >= 1.

Can’t use arrays. The algorithm to solving this problem must involve the repeated creation and merger of lists. Specifically 5 lists; a final list, temp list, and three term lists.

“The final list grows by being merged with the current temp list. The temp list, in turn, is replaced by the merger of the three term lists. New term lists are generated by multiplying the new temp list by 2, 3, and 5 respectively“

The desired sequence would go as follows: 2, 3, 4, 5, 6, 8, 9, 10, 12, 15, 16, 18, 20, . . .

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T15:23:36+00:00Added an answer on June 11, 2026 at 3:23 pm

    As you’ve explained in your question, you might do your algorithm recursively.

    At step n:

    The final list will represent the set F(n) = {m | m = 2^i*3^j*5^k, 1<=i+j+k<=n}

    The temp list will represent the set T(n) = {m | m = 2^i*3^j*5^k, i+j+k=n}

    Then, the “L2” term list will be L2(n) = 2*T(n-1)

    the “L3” term list will be L3(n) = 3*T(n-1)

    the “L5” term list will be L5(n) = 5*T(n-1)

    To get T, T(n) = merge(L2(n), L3(n), L5(n))

    To get F, F(n) = merge(F(n-1), T(n))

    Once you’ve got this, you have to implement a function to merge 2 lists. In the main function, you just have to translate these in Java.

    You can also make the lists always sorted so that merge is easy and efficient! In java, I think you can use LinkedList or ArrayList, both work fine.

    After all, it’s your homework.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

First, let me state that this is a programming question (and thus does not
This is not really a programming question, more of an algorithmic one. The problem:
Ok, this is a C programming homework question. But I'm truly stuck. I ask
Disclaimer: this question is directly related to my programming homework. My C++ assignment consists
Possible Duplicate: Counting inversions in an array This is a programming question that I
I will preface to say that this is my first question. I am currently
This is more of a business-oriented programming question that I can't seem to figure
I know that this is strictly seen not a programming question but since it
This is no typical programming question. I am currently developing an app using the
This is not a programming question per se but a question that may be

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.