This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A193568 #18 Feb 16 2025 08:33:15 %S A193568 38,58,73,83,116,119,161,166,191,235,253,299,307,308,325,352,357,370, %T A193568 375,380,468,486,489,498,523,532,537,573,611,616,648,661,679,684,697, %U A193568 703,730,735,753,769,796,803,830,846,849,864,894,911,929,948,967,976 %N A193568 Unhappy numbers which enter the cycle (4, 16, 37, 58, 89, 145, 42, 20) at 58. %H A193568 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/UnhappyNumber.html">Unhappy Number</a>. %e A193568 468 is such a number of height 4 because it enters the cycle at 58 in 4 steps: 468 -> 116 -> 38 -> 73 -> 58 -> 89 -> 145 -> 42 -> 20 -> 4 -> 16 -> 37 -> 58 -> ... %p A193568 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 A193568 a:=[]: for i from 1 while nops(a)<30 do Q:=S(i); A:=Q[nops(Q)]; if A=58 then a:=[op(a),i] fi; od: print(op(a)); %Y A193568 Cf. A031177, A039943. %K A193568 nonn,base %O A193568 1,1 %A A193568 _Martin Renner_, Jul 31 2011