Tag Info

Hot answers tagged

2

Just to ensure this one isn't going to engross the unanswered internal bag. As I said in a comment the following might work for two "iterations": base = List /@ Range@100; base1 = {#, Tr[IntegerDigits[#]^2]} & /@ base[[All, -1]]; base2 = {#, Tr[IntegerDigits[#]^2]} & /@ base1[[All, -1]]; DirectedEdge @@@ Union[base1, base2]; Graph[%, GraphLayout ...


1

I had interpreted the question a bit differently. The word "iterative" in the question led me to think that OP might want to see the graphs connecting the happy numbers and unhappy numbers in Mathematica. Here's how to get the two graphs: nums = Table[NestWhileList[Composition[#.# &, IntegerDigits], k, (FreeQ @@ Through[{Most, ...



Only top voted, non community-wiki answers of a minimum length are eligible