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.

A131839 Additive persistence of Sierpinski numbers of first kind.

Original entry on oeis.org

0, 0, 2, 2, 2, 3, 2, 3, 3, 1, 2, 3, 3, 2, 2, 3, 3, 3, 3, 2, 3, 3, 3, 3, 2, 3, 3, 3, 3, 3, 3, 2, 3, 2, 2, 3, 3, 3, 4, 2, 3, 3, 2, 3, 3, 3, 3, 3, 3, 2, 3, 2, 2, 4, 3, 3, 3, 3, 3, 3, 3, 3, 4, 3, 3, 3, 3, 3, 4, 2, 3, 4, 3, 3, 3, 3, 3, 3, 3, 3, 4, 3, 3, 4, 3, 3, 4, 3, 3, 3, 3, 3, 4, 3, 3, 4, 3, 3, 4, 1, 3, 4, 3, 3, 4
Offset: 1

Views

Author

Keywords

Examples

			Sierpinski number 257 --> 2+5+7 = 14 --> 1+4 = 5 thus persistence is 2.
The sixteenth Sierpinski number is 16^16 + 1 = 18446744073709551617 --> 1+8+4+4+6+7+4+4+0+7+3+7+0+9+5+5+1+6+1+7 = 89 --> 8+9 = 17 --> 1+7 = 8, thus a(16) = 3 because in three steps we obtain a number < 10. - _Antti Karttunen_, Dec 15 2017
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local t, count;
      t:= n^n+1;
      count:= 0;
      while t > 9 do
        count:= count+1;
        t:= convert(convert(t,base,10),`+`);
      od;
      count
    end proc:
    map(f, [$1..100]); # Robert Israel, Dec 18 2017
  • Mathematica
    f[n_] := Length@ NestWhileList[Plus @@ IntegerDigits@# &, n^n + 1, UnsameQ@## &,     All] - 2; Array[f, 105] (* Robert G. Wilson v, Dec 18 2017 *)
  • PARI
    allocatemem(2^30);
    A007953(n) = { my(s); while(n, s+=n%10; n\=10); s; };
    A031286(n) = { my(s); while(n>9, s++; n=A007953(n)); s; }; \\ This function after Charles R Greathouse IV, Sep 13 2012
    A014566(n) = (1+(n^n));
    A131839(n) = A031286(A014566(n)); \\ Antti Karttunen, Dec 15 2017

Formula

a(n) = A031286(A014566(n)). - Antti Karttunen, Dec 15 2017

Extensions

Erroneous terms (first at n=16) corrected by Antti Karttunen, Dec 15 2017