login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A193571 Unhappy numbers which enter the cycle (4, 16, 37, 58, 89, 145, 42, 20) at 42. 0
42, 154, 389, 398, 415, 451, 514, 541, 839, 893, 938, 983, 1045, 1054, 1126, 1162, 1216, 1261, 1344, 1405, 1434, 1443, 1450, 1504, 1540, 1588, 1612, 1621, 1669, 1696, 1858, 1885, 1966, 2116, 2161, 2235, 2253, 2325, 2352, 2523, 2532, 2611, 3089, 3098, 3144 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,1

LINKS

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

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

EXAMPLE

389 is such a number of height 2 because it enters the cycle at 42 in 2 steps: 389 -> 154 -> 42 -> 20 -> 4 -> 16 -> 37 -> 58 -> 89 -> 145 -> 42 -> ...

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=42 then a:=[op(a), i] fi; od: print(op(a));

CROSSREFS

Cf. A031177, A039943.

Sequence in context: A188126 A189500 A075289 * A326384 A263285 A263300

Adjacent sequences:  A193568 A193569 A193570 * A193572 A193573 A193574

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 August 4 20:28 EDT 2021. Contains 346455 sequences. (Running on oeis4.)