File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Programming Diversions and the fly likes Next numbers in series... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Other » Programming Diversions
Bookmark "Next numbers in series..." Watch "Next numbers in series..." New topic
Author

Next numbers in series...

Tim West
Ranch Hand

Joined: Mar 15, 2004
Posts: 539
OK, this is an oldie but a goodie...
1, 11, 21, 1211, 111221, 312211, ???
For the moment, if you get it, why not just post the next few and let other people go mad? ;-)

~ Tim
Arjun Shastry
Ranch Hand

Joined: Mar 13, 2003
Posts: 1871
Originally posted by Tim West:

1, 11, 21, 1211, 111221, 312211, ???

13112221,1113213211,31131212131221,1321131112111213112211,.....

who will write a program now?


MH
Sameer Jamal
Ranch Hand

Joined: Feb 16, 2001
Posts: 1870
Originally posted by Ram Abdullah D'Souza:

13112221,1113213211,31131212131221,1321131112111213112211,.....

who will write a program now?

for what? telling how many ones and twos are there
Brian Vex
Greenhorn

Joined: Sep 14, 2005
Posts: 1
ummm...can you PLEASE explain that one to me? it had me going
s mahen perera
Ranch Hand

Joined: Mar 08, 2005
Posts: 101
1, 11, 21, 1211, 111221, 312211, ???

--------------------------------------------------------------------------------


13112221,1113213211,31131212131221,1321131112111213112211,.....
okokok it goes like this

in each number, two digits are used to represent a particular digit or the same consecutive digit in the previous number. The first digit is the number of times it is been repeated and the second digit is the value of the digit.

For example : First number = 1
Second number = "one" 1 = 11 --> because there is one one
Thrird number = 21 -->(beacause there is 2 ones )
Fourth number = 1211 -->(becaouse there is one 2 and one 1 )
continuing similarly...
111221, 312211, 13112221,1113213211,31131212131221,1321131112111213112211 ...

Hope u got my explanation

now someone write the program to do this
Arjunkumar Shastry
Ranch Hand

Joined: Feb 28, 2005
Posts: 986
I think this should work.


Namma Suvarna Karnataka
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Next numbers in series...
 
Similar Threads
SCWCD passed with 88%
Video Games Racial Diversity
SCJP 1.5 beta
Passed SCDJWS with 97%
creating .exe in jbuilder X