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.

A290223 Algorithm: s(k) = n. s(k+1) = s(k) - digitsum(s(k))^2 if s(k) >= 0 and s(k+1) = s(k)+digitsum(abs(s(k)))^2 if s(k) < 0. Below gives the end behavior for each number n.

This page as a plain text file.
%I A290223 #6 Jul 24 2017 12:31:18
%S A290223 0,2,3,6,6,6,3,11,9,9,3,3,6,6,6,3,11,9,0,3,3,6,2,6,3,11,9,9,11,3,6,3,
%T A290223 6,3,11,9,9,11,3,6,3,6,3,6,9,9,11,3,6,3,6,3,6,9,9,11,3,6,6,6,3,2,9,9,
%U A290223 11,3,6,6,6,3,3,9,9,11,3,6,2,6,3,3,0,9,11,3,6,6,6,3,6,9,9,11,3,6,6,6,3,6,9,9,3,3,6,3,6,3,3,9,9
%N A290223 Algorithm: s(k) = n. s(k+1) = s(k) - digitsum(s(k))^2 if s(k) >= 0 and s(k+1) = s(k)+digitsum(abs(s(k)))^2 if s(k) < 0. Below gives the end behavior for each number n.
%C A290223 0 means the sequence s(k) becomes the 0 sequence.
%C A290223 2 means the sequence s(k) becomes 2, -2, 2, -2, ...
%C A290223 3 means the sequence s(k) becomes 3, -6, 30, 21, 12, 3, ...
%C A290223 6 means the sequence s(k) becomes 6, -30, -21, -12, -3, 6, ...
%C A290223 9 means the sequence s(k) oscillates between two numbers, each of which have a digit sum of 9. For example, 18 -> -63 -> 18 -> -63 -> ... so a(18) = 9.
%C A290223 11 means the sequence s(k) oscillates between two numbers, each of which have a digit sum of 11. For example, 65 -> -56 -> 65 -> ... so a(65) = 11.
%C A290223 a(n) = 2 for n = 2, 23, 62, 77, 119, 194, 287, 398. The next number n such that a(n) = 2 is over 10^5. This is believed to be finite.
%C A290223 a(n) = 11 for n = 8, 17, 26, 29, 35, 38, 47, 56, 65, 74, 83, 92, 149, 158, 167, 197. The next number n is over 10^5. This is believed to be finite.
%C A290223 The subsequences when a(n)=0, 3, 6, and 9 are believed to be infinite.
%e A290223 a(19) = 0 because 19 - (1+9)^2 = -81. Then -81 + (8+1)^2 = 0.
%e A290223 a(13) = 6 because 13 - (1+3)^2 = -3. Then -3 + (3)^2 = 6.
%e A290223 a(17) = 11 because 17 - (1+7)^2 = -47. Then -47 + (4+7)^2 = 74. Then 74 - (7+4)^2 = -47, and so on.
%e A290223 a(23) = 2 because 23 - (2+3)^2 = -2. Then -2 + (2)^2 = 2.
%e A290223 a(25) = 3 because 25 - (2+5)^2 = -24. Then -24 + (2+4)^2 = 12. Then 12 - (1+2)^2 = 3.
%e A290223 a(28) = 9 because 28 - (2+8)^2 = -72. Then -72 + (7+2)^2 = 9. Then 9-(9)^2 = -72, and so on.
%o A290223 (PARI)
%o A290223 a(n)=k=n;c=1;v=List();listput(v,k);while(c,if(k>=0,k-=sumdigits(k)^2;c+=1;if(k==2||k==3||k==0||k==6||k==9,return(k));if(vecsearch(Vec(v),k),return(sumdigits(abs(k))));listput(v,k));if(k<0,k+=sumdigits(-k)^2;c+=1;if(k==2||k==3||k==0||k==6||k==9,return(k));if(vecsearch(Vec(v),k),return(sumdigits(abs(k))));listput(v,k));c+=1)
%Y A290223 Cf. A007953, A003132.
%K A290223 nonn,base
%O A290223 1,2
%A A290223 _Derek Orr_, Jul 24 2017