next secuence of number ...

All off topic discussions go here. Everything from the funny thing your cat did to your favorite tv shows. Non-programming computer questions are ok too.
Post Reply
fachamix
Posts: 21
Joined: Thu Oct 26, 2006 9:30 pm

next secuence of number ...

Post by fachamix »

TELL ME THE NEXT SECUENCE OF NUMBERS :D

please write the answer in WHITE COLOR, so another reader can read the post without watching the answer (unintentionaly meaning :D)


1
11
21
1211
111221
312211
13112221
1113213211
31131211131221
User avatar
jhawthorn
Member
Member
Posts: 58
Joined: Sun Nov 26, 2006 4:06 pm
Location: Victoria, BC, Canada
Contact:

Post by jhawthorn »

White does nothing to us using one of the MTdark themes.

1
11
21
1211
111221
312211
13112221
1113213211
31131211131221
13211311123113112211
11131221133112132113212221
3113112221232112111312211312113211
1321132132111213122112311311222113111221131221
11131221131211131231121113112221121321132132211331222113112211
311311222113111231131112132112311321322112111312211312111322212311322113212221
132113213221133112132113311211131221121321131211132221123113112221131112311332111213211322211312113211
11131221131211132221232112111312212321123113112221121113122113111231133221121321132132211331121321231231121113122113322113111221131221
31131122211311123113321112131221123113112211121312211213211321322112311311222113311213212322211211131221131211132221232112111312111213111213211231131122212322211331222113112211
1321132132211331121321231231121113112221121321132122311211131122211211131221131211132221121321132132212321121113121112133221123113112221131112311332111213122112311311123112111331121113122112132113213211121332212311322113212221
11131221131211132221232112111312111213111213211231132132211211131221131211221321123113213221123113112221131112311332211211131221131211132211121312211231131112311211232221121321132132211331121321231231121113112221121321133112132112312321123113112221121113122113121113123112112322111213211322211312113211
311311222113111231133211121312211231131112311211133112111312211213211312111322211231131122211311122122111312211213211312111322211213211321322113311213212322211231131122211311123113223112111311222112132113311213211221121332211211131221131211132221232112111312111213111213211231132132211211131221232112111312211213111213122112132113213221123113112221131112311311121321122112132231121113122113322113111221131221

I cheated a little... This goes on for several megabytes.

EDIT: You've posted this already: here. Now I don't feel so cool for replying. What was the point of a repost?
User avatar
os64dev
Member
Member
Posts: 553
Joined: Sat Jan 27, 2007 3:21 pm
Location: Best, Netherlands

Post by os64dev »

EDIT: You've posted this already: here. Now I don't feel so cool for replying. What was the point of a repost?
Problably to feel important :twisted:
Author of COBOS
GLneo
Member
Member
Posts: 237
Joined: Wed Dec 20, 2006 7:56 pm

Post by GLneo »

i understand the sequence but could someone give me a hint on how to make a program ( in c ) to solve the next line to the n'th place?

thx!
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Post by Combuster »

...use strings rather than numbers?
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
fachamix
Posts: 21
Joined: Thu Oct 26, 2006 9:30 pm

....

Post by fachamix »

u have to use string instead of numbers ( or at least you yould treat the sequence as that)


is not hard to do it, you have to print "WHAT YOU SEE"
User avatar
AndrewAPrice
Member
Member
Posts: 2299
Joined: Mon Jun 05, 2006 11:00 pm
Location: USA (and Australia)

Post by AndrewAPrice »

Even on the default theme, by monitor makes a clear distinction between the background and the white text.
My OS is Perception.
nick8325
Member
Member
Posts: 200
Joined: Wed Oct 18, 2006 5:49 am

Post by nick8325 »

Exactly, use a string and just count the number of consecutive repeated characters.

Here's a program in Haskell that generates the sequence, FWIW:

Code: Select all

import Data.List

next = concat . map writeOut . group
    where writeOut xs = show (length xs) ++ [head xs]
allSequence = iterate next "1"
allSequence is the whole sequence (an infinite list).
User avatar
Colonel Kernel
Member
Member
Posts: 1437
Joined: Tue Oct 17, 2006 6:06 pm
Location: Vancouver, BC, Canada
Contact:

Post by Colonel Kernel »

Haskell syntax has always bothered me intensely... What good is it for a language to be that concise if the code is just about write-only? :P
Top three reasons why my OS project died:
  1. Too much overtime at work
  2. Got married
  3. My brain got stuck in an infinite loop while trying to design the memory manager
Don't let this happen to you!
fachamix
Posts: 21
Joined: Thu Oct 26, 2006 9:30 pm

..

Post by fachamix »

i agree with you Colonel Kernel
nick8325
Member
Member
Posts: 200
Joined: Wed Oct 18, 2006 5:49 am

Post by nick8325 »

I find Haskell quite easy to read...it did take me a while to get used to, though.
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Post by Combuster »

It has probably to do with the fact that Haskell employs a totally different programming paradigm. If you have only done object-oriented programming then the workings of an haskell program is indeed like a big bloat of abracadabra.

From the people I've seen, it takes about three weeks to get an understanding of what is actually happening.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
User avatar
Colonel Kernel
Member
Member
Posts: 1437
Joined: Tue Oct 17, 2006 6:06 pm
Location: Vancouver, BC, Canada
Contact:

Post by Colonel Kernel »

Combuster wrote:It has probably to do with the fact that Haskell employs a totally different programming paradigm. If you have only done object-oriented programming then the workings of an haskell program is indeed like a big bloat of abracadabra.

From the people I've seen, it takes about three weeks to get an understanding of what is actually happening.
No, that's not it. I'm quite comfortable with functional programming. I think Haskell has exactly the opposite problem that Lisp has -- instead of too many parentheses, Haskell doesn't have nearly enough. ;)
Top three reasons why my OS project died:
  1. Too much overtime at work
  2. Got married
  3. My brain got stuck in an infinite loop while trying to design the memory manager
Don't let this happen to you!
Post Reply