Click here to Skip to main content
15,900,666 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: Coding Challenge - ANSWER Pin
Dave Kreskowiak4-Dec-17 4:15
mveDave Kreskowiak4-Dec-17 4:15 
GeneralRe: Coding Challenge - ANSWER Pin
PeejayAdams5-Dec-17 22:48
PeejayAdams5-Dec-17 22:48 
GeneralRe: Coding Challenge - ANSWER Pin
Paulo_JCG12-Dec-17 4:59
professionalPaulo_JCG12-Dec-17 4:59 
GeneralRe: Coding Challenge - ANSWER Pin
Dave Kreskowiak12-Dec-17 5:24
mveDave Kreskowiak12-Dec-17 5:24 
GeneralRe: Coding Challenge - Morris Sequence Pin
Paulo_JCG12-Dec-17 4:53
professionalPaulo_JCG12-Dec-17 4:53 
GeneralRe: Coding Challenge - Morris Sequence Pin
Member 1319430215-Mar-18 5:07
Member 1319430215-Mar-18 5:07 
GeneralRe: Coding Challenge - Morris Sequence Pin
Dave Kreskowiak15-Mar-18 5:53
mveDave Kreskowiak15-Mar-18 5:53 
GeneralRe: Coding Challenge - Morris Sequence Pin
Member 1319430215-Mar-18 6:23
Member 1319430215-Mar-18 6:23 
John Conway did extensive research a while back on this sequence. He discovered that after a certain point (level 8), each level can be written as a series of 92 subsequences that in turn evolve into one or several of the 92 subsequences.

So it's possible to write a program that just keeps track of the number of times a particular subsequence has been seen, and then "evolve" it for the next level, which is iterating over a 92 element array for each level and creating a new 92 element array for the next. Since the size of each subsequence is known, calculating the length of a particular level is as simple as multiplying the count of each subsequence by the length, and adding them all together.

I can post the source here if that's kosher. It's not pretty but it works Smile | :)



GeneralRe: Coding Challenge - Morris Sequence Pin
Member 1319430215-Mar-18 7:05
Member 1319430215-Mar-18 7:05 
GeneralRe: Coding Challenge - Morris Sequence Pin
Dave Kreskowiak15-Mar-18 7:34
mveDave Kreskowiak15-Mar-18 7:34 
GeneralRe: Coding Challenge - Morris Sequence Pin
Member 1319430215-Mar-18 8:24
Member 1319430215-Mar-18 8:24 
GeneralThey're getting better. Pin
Jörgen Andersson30-Nov-17 7:58
professionalJörgen Andersson30-Nov-17 7:58 
GeneralRe: They're getting better. Pin
CPallini30-Nov-17 8:14
mveCPallini30-Nov-17 8:14 
GeneralRe: They're getting better. Pin
MarkTJohnson30-Nov-17 8:32
professionalMarkTJohnson30-Nov-17 8:32 
GeneralRe: They're getting better. Pin
ZurdoDev30-Nov-17 8:47
professionalZurdoDev30-Nov-17 8:47 
GeneralRe: They're getting better. Pin
Jeremy Falcon30-Nov-17 10:56
professionalJeremy Falcon30-Nov-17 10:56 
GeneralRe: They're getting better. Pin
Jörgen Andersson30-Nov-17 18:38
professionalJörgen Andersson30-Nov-17 18:38 
GeneralRe: They're getting better. Pin
Munchies_Matt30-Nov-17 21:09
Munchies_Matt30-Nov-17 21:09 
GeneralRIP Gomer Pyle (Jim Nabors) Pin
Cornelius Henning30-Nov-17 7:34
professionalCornelius Henning30-Nov-17 7:34 
GeneralRe: RIP Gomer Pyle (Jim Nabors) Pin
Marc Clifton30-Nov-17 7:38
mvaMarc Clifton30-Nov-17 7:38 
GeneralRe: RIP Gomer Pyle (Jim Nabors) Pin
raddevus30-Nov-17 8:11
mvaraddevus30-Nov-17 8:11 
GeneralRe: RIP Gomer Pyle (Jim Nabors) Pin
MarkTJohnson30-Nov-17 8:34
professionalMarkTJohnson30-Nov-17 8:34 
GeneralImportant! Updated Allergy Information Pin
PeejayAdams30-Nov-17 5:42
PeejayAdams30-Nov-17 5:42 
GeneralRe: Important! Updated Allergy Information Pin
Dave Kreskowiak30-Nov-17 5:49
mveDave Kreskowiak30-Nov-17 5:49 
GeneralRe: Important! Updated Allergy Information Pin
Richard MacCutchan30-Nov-17 5:50
mveRichard MacCutchan30-Nov-17 5:50 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Straw Poll

Were you affected by the geomagnetic storms this past weekend?
Communication disruptions, electrified pipes, random unexplained blue-screens in Windows - the list of effects is terrifying.
  Results   492 votes