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.

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

This page as a plain text file.
%I A193567 #18 Feb 16 2025 08:33:15
%S A193567 3,9,18,30,33,37,39,47,56,57,59,61,65,74,75,81,90,93,95,106,108,111,
%T A193567 114,122,125,137,138,141,144,148,152,157,158,160,173,175,178,180,183,
%U A193567 184,185,187,212,215,221,225,227,246,251,252,256,258,264,265,272,285
%N A193567 Unhappy numbers which enter the cycle (4, 16, 37, 58, 89, 145, 42, 20) at 37.
%H A193567 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/UnhappyNumber.html">Unhappy Number</a>.
%e A193567 568 is such a number of height 7 because it enters the cycle at 37 in 7 steps: 568 -> 125 -> 30 -> 9 -> 81 -> 65 -> 61 -> 37 -> 58 -> 89 -> 145 -> 42 -> 20 -> 4 -> 16 -> 37 -> ...
%p A193567 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 A193567 a:=[]: for i from 1 while nops(a)<30 do Q:=S(i); A:=Q[nops(Q)]; if A=37 then a:=[op(a),i] fi; od: print(op(a));
%Y A193567 Cf. A031177, A039943.
%K A193567 nonn,base
%O A193567 1,1
%A A193567 _Martin Renner_, Jul 31 2011