Regular numbers

you have a sequence where each number is a multiple of 2 or 5 (so: 2^i * 5^j). Given the beginning of the sequence as 1,2,4,5,8,10,16... and find a algorithm to calculate the next number in the sequence?

Comments

  1. this is generally a combination of three series
    series 1 :powers of 2(1,2,4,8....)
    series 2: powers of 5(1,5,25,125....)
    series 3 All product derived from series 1 and 2 such that they are arranged in increasing order and you can you can exclude the your product with 1 to avoid redundancy i.e. (10,20,40,50,....)
    And now finally you can derived the series in such a way by selecting the minimum number.

    ReplyDelete
  2. @Muffadal yeah right...and the working code for this i will post very soon..:)

    ReplyDelete

Post a Comment

Popular posts from this blog

Circular game survival