[go: up one dir, main page]

login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A193572 Unhappy numbers which enter the cycle (4, 16, 37, 58, 89, 145, 42, 20) at 20. 0
20, 24, 204, 224, 240, 242, 402, 420, 422, 1133, 1313, 1331, 2004, 2024, 2040, 2042, 2204, 2240, 2400, 2402, 2420, 3113, 3131, 3311, 4002, 4020, 4022, 4200, 4202, 4220, 4899, 4989, 4998, 5779, 5797, 5977, 7579, 7597, 7759, 7795, 7957, 7975, 8499, 8949, 8994 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
LINKS
Eric Weisstein's World of Mathematics, Unhappy Number.
EXAMPLE
4899 is such a number of height 3 because it enters the cycle at 20 in 3 steps: 4899 -> 242 -> 24 -> 20 -> 4 -> 16 -> 37 -> 58 -> 89 -> 145 -> 42 -> 20 -> ...
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=20 then a:=[op(a), i] fi; od: print(op(a));
CROSSREFS
Sequence in context: A263016 A107302 A219392 * A167323 A112819 A070684
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 | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified August 30 11:31 EDT 2024. Contains 375543 sequences. (Running on oeis4.)