login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A193565 Unhappy numbers which enter the cycle (4, 16, 37, 58, 89, 145, 42, 20) at 4 0
2, 4, 11, 78, 87, 101, 110, 113, 131, 168, 179, 186, 197, 200, 249, 257, 259, 275, 294, 295, 311, 429, 449, 467, 476, 492, 494, 527, 529, 559, 567, 572, 576, 592, 595, 618, 647, 657, 674, 675, 681, 708, 719, 725, 746, 752, 756, 764, 765, 779, 780, 791, 797 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,1

LINKS

Table of n, a(n) for n=1..53.

Weisstein, Eric E.: MathWorld -- Unhappy Number.

EXAMPLE

7899 is such a number of height 6 because it enters the cycle at 4 in 6 steps: 7899 -> 275 -> 78 -> 113 -> 11 -> 2 -> 4 -> 16 -> 37 -> 58 -> 89 -> 145 -> 42 -> 20 -> 4 -> ...

MAPLE

S:=proc(n) local Q, k, N, z; Q:=[n]; for k from 1 do N:=convert(Q[k], base, 10); z:=sum(N['i']^2, 'i'=1..nops(N)); if not member(z, Q) then Q:=[op(Q), z]; else Q:=[op(Q), z]; break; fi; od; return Q; end:

a:=[]: for i from 1 while nops(a)<30 do Q:=S(i); A:=Q[nops(Q)]; if A=4 then a:=[op(a), i] fi; od: print(op(a));

CROSSREFS

Cf. A031177, A039943.

Sequence in context: A007903 A182100 A006894 * A198864 A038093 A057284

Adjacent sequences:  A193562 A193563 A193564 * A193566 A193567 A193568

KEYWORD

nonn,base

AUTHOR

Martin Renner, Jul 31 2011

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 25 03:50 EDT 2019. Contains 321450 sequences. (Running on oeis4.)