This is going to sound really corny, but write the stack on paper or even better take some napkins or something, write the numbers/objects on them and stack them up.
@MartinBüttner: (and @PeterTaylor) Would it be acceptable for me to post an answer in Python that uses effectively the same algorithm as yours? I developed it independently (i.e., while it was in the sandbox)...
code-golf
{{Meta: a double enclosure {{...}} means a meta comment.}}
The cosmic number!
There is an old comic strip that relates to this challenge. {{Rewrite intro + link}}
{{transition}}
So, your task is to print the steps to get to the cosmic number. To get there, one simply counts then num...
@CᴏɴᴏʀO'Bʀɪᴇɴ Although there's an example implementation suggesting that the output should be the entire sequence eventually leading to four, it would be good to state that explicitly in the question
@CᴏɴᴏʀO'Bʀɪᴇɴ Do you know if all numbers eventually reach four? Four gives a 1-cycle. Do you know if it has been proved that there are no other 1-cycles, or possibly cycles of more than 1?
I've written the worst code of my life. I'm amazed this actually compiles and runs. (If you can figure out what it prints when run without running it, I'll give you cookies ^^).
Squares of squares
Premise
One night, I was just contemplating on numbers. I found out about something unique about numbers like 7, 10, 12, 13, and more. They are squares of squares! Meaning, that when squared, are comprised of squares themselves. The OEIS calls them Squares which are a decimal...
Squares of squares
Premise
One night, I was just contemplating on numbers. I found out about something unique about numbers like 7, 10, 12, 13, and more. They are squares of squares! Meaning, that when squared, are comprised of squares themselves. The OEIS calls them Squares which are a decimal...
@TanMath It can take several days to get enough feedback in the sandbox, simply because not everyone is around every day. It will take some patience... In the meantime it can help to write a reference implementation to see if it throws up any problems we haven't thought of.
@El'endiaStarman I got that - I wasn't intending to disagree. The sandbox post has been brought up in chat several times this evening so I was trying to give an alternative to reposting.