The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
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!)
A193565 Unhappy numbers which enter the cycle (4, 16, 37, 58, 89, 145, 42, 20) at 4. 0

%I #19 Feb 11 2024 22:31:41

%S 2,4,11,78,87,101,110,113,131,168,179,186,197,200,249,257,259,275,294,

%T 295,311,429,449,467,476,492,494,527,529,559,567,572,576,592,595,618,

%U 647,657,674,675,681,708,719,725,746,752,756,764,765,779,780,791,797

%N Unhappy numbers which enter the cycle (4, 16, 37, 58, 89, 145, 42, 20) at 4.

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/UnhappyNumber.html">Unhappy Number</a>.

%e 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 -> ...

%p 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:

%p 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));

%Y Cf. A031177, A039943.

%K nonn,base

%O 1,1

%A _Martin Renner_, Jul 31 2011

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 June 6 00:30 EDT 2024. Contains 373110 sequences. (Running on oeis4.)