cp's OEIS Frontend

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.

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

This page as a plain text file.
%I A193569 #21 Feb 16 2025 08:33:15
%S A193569 5,6,8,12,14,17,21,22,25,27,29,34,35,36,41,43,45,46,48,50,52,53,54,55,
%T A193569 60,63,64,66,67,71,72,76,80,84,85,89,92,99,102,104,107,112,115,118,
%U A193569 120,121,123,124,126,127,132,135,136,140,142,146,147,151
%N A193569 Unhappy numbers which enter the cycle (4, 16, 37, 58, 89, 145, 42, 20) at 89.
%H A193569 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/UnhappyNumber.html">Unhappy Number</a>.
%e A193569 15999 is such a number of height 12 because it enters the cycle at 89 in 12 steps: 15999 -> 269 -> 121 -> 6 -> 36 -> 45 -> 41 -> 17 -> 50 -> 25 -> 29 -> 85 -> 89 -> 145 -> 42 -> 20 -> 4 -> 16 -> 37 -> 58 -> 89 -> ...
%p A193569 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 A193569 a:=[]: for i from 1 while nops(a)<30 do Q:=S(i); A:=Q[nops(Q)]; if A=89 then a:=[op(a),i] fi; od: print(op(a));
%Y A193569 Cf. A031177, A039943.
%K A193569 nonn,base
%O A193569 1,1
%A A193569 _Martin Renner_, Jul 31 2011