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.

Previous Showing 11-20 of 25 results. Next

A304373 Numbers n with additive persistence = 4.

Original entry on oeis.org

19999999999999999999999, 28999999999999999999999, 29899999999999999999999, 29989999999999999999999, 29998999999999999999999, 29999899999999999999999, 29999989999999999999999, 29999998999999999999999, 29999999899999999999999, 29999999989999999999999
Offset: 1

Views

Author

Jaroslav Krizek, May 28 2018

Keywords

Examples

			Repeatedly taking the sum of digits starting with 19999999999999999999999 gives 199, 19, 10 and 1. There are four steps, so the additive persistence is 4 and 19999999999999999999999 is a member.
		

Crossrefs

Cf. A031286.
Cf. Numbers with additive persistence k: A304366 (k=1), A304367 (k=2), A304368 (k=3).

Programs

  • Mathematica
    Take[ Sort@ Flatten[ (FromDigits /@ Permutations@#) & /@ IntegerPartitions[ 199, {23}, Range@ 9]], 10000] (* first 10000 terms, Giovanni Resta, May 29 2018 *)
  • PARI
    nb(n) = {my(nba = 0); while (n > 9, n = sumdigits(n); nba++); nba;}
    isok(n) = nb(n) == 4; \\ Michel Marcus, May 29 2018

Formula

A031286(a(n)) = 4.

A381963 Irregular triangle read by rows, where row n lists the iterates of f(x), starting at x = n until f(x) < 10, where f(x) is the digital sum of x (A007953).

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1, 11, 2, 12, 3, 13, 4, 14, 5, 15, 6, 16, 7, 17, 8, 18, 9, 19, 10, 1, 20, 2, 21, 3, 22, 4, 23, 5, 24, 6, 25, 7, 26, 8, 27, 9, 28, 10, 1, 29, 11, 2, 30, 3, 31, 4, 32, 5, 33, 6, 34, 7, 35, 8, 36, 9, 37, 10, 1, 38, 11, 2, 39, 12, 3
Offset: 0

Views

Author

Paolo Xausa, Mar 11 2025

Keywords

Examples

			Triangle begins:
  n\k|  0   1   2
  ---------------
   0 |  0;
   1 |  1;
   2 |  2;
   3 |  3;
   4 |  4;
   5 |  5;
   6 |  6;
   7 |  7;
   8 |  8;
   9 |  9;
  10 | 10,  1;
  11 | 11,  2;
  12 | 12,  3;
  13 | 13,  4;
  14 | 14,  5;
  15 | 15,  6;
  16 | 16,  7;
  17 | 17,  8;
  18 | 18,  9;
  19 | 19, 10,  1;
  20 | 20,  2;
  ...
		

Crossrefs

Cf. A007953, A010888 (right border), A031286 (row lengths - 1), A381964 (row sums).

Programs

  • Mathematica
    A381963row[n_] := NestWhileList[DigitSum, n, # >= 10 &];
    Array[A381963row, 40, 0]

Formula

T(n,0) = n and, for k = 1..A031286(n), T(n,k) = A007953(T(n,k-1)).

A239480 Palindromes such that additive and multiplicative persistences coincide.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 22, 33, 99, 101, 111, 121, 131, 141, 151, 161, 171, 202, 212, 222, 262, 282, 303, 313, 393, 404, 424, 454, 474, 525, 545, 565, 585, 595, 636, 656, 676, 757, 838, 858, 959, 1001, 1111, 1221, 1331, 1441, 1991, 2002, 2112, 2552
Offset: 1

Views

Author

Arkadiusz Wesolowski, Mar 20 2014

Keywords

Comments

Palindromes k for which A031286(k) = A031346(k).

Examples

			99 -> 18 -> 9 has additive persistence 2. 99 -> 81 -> 8 has multiplicative persistence 2. The palindromic number 99 is therefore in the sequence.
		

Crossrefs

Programs

  • PARI
    for(n=0, 2552, s=Vec(Str(n)); if(s==vecextract(s, "-1..1"), v=n; a=0; while(n>9, a++; n=sumdigits(n)); n=v; m=0; while(n>9, m++; d=digits(n); n=prod(k=1, #d, d[k])); n=v; if(a==m, print1(n, ", "))));
    
  • Python
    from math import prod
    from itertools import count, islice, product
    def A031286(n):
        ap = 0
        while n > 9: n, ap = sum(map(int, str(n))), ap+1
        return ap
    def A031346(n):
        mp = 0
        while n > 9: n, mp = prod(map(int, str(n))), mp+1
        return mp
    def is_pal(n): return (s:=str(n)) == s[::-1]
    def pals(base=10): # all d-digit palindromes
        digits = "".join(str(i) for i in range(base))
        for d in count(1):
            for p in product(digits, repeat=d//2):
                if d > 1 and p[0] == "0": continue
                left = "".join(p); right = left[::-1]
                for mid in [[""], digits][d%2]: yield int(left + mid + right)
    def ok(n): return is_pal(n) and A031286(n) == A031346(n)
    def agen(): yield from filter(ok, pals())
    print(list(islice(agen(), 20))) # Michael S. Branicky, Jun 22 2023

Formula

A002113 INTERSECT A239427.

A381964 Row sums of A381963.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 30, 22, 24, 26, 28, 30, 32, 34, 36, 39, 42, 33, 35, 37, 39, 41, 43, 45, 48, 51, 54, 44, 46, 48, 50, 52, 54, 57, 60, 63, 66, 55, 57, 59, 61, 63, 66, 69, 72, 75, 78, 66, 68, 70, 72, 75, 78, 81, 84, 87, 90
Offset: 0

Views

Author

Paolo Xausa, Mar 11 2025

Keywords

Crossrefs

Programs

  • Mathematica
    A381964[n_] := Total[NestWhileList[DigitSum, n, # >= 10 &]];
    Array[A381964, 100, 0]

Formula

a(n) = Sum_{k = 0..A031286(n)} A381963(n,k).

A107450 Additive persistence of the prime numbers.

Original entry on oeis.org

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

Views

Author

Keywords

Examples

			29 -> 2 + 9 = 11 -> 1 + 1 = 2 -> persistence = 2
487 -> 4 + 8 + 7 = 19 -> 1 + 9 = 10 -> 1 + 0 = 1 -> persistence = 3
		

Crossrefs

Cf. A031286 (additive persistence), A129985 (multiplicative persistence of primes).

Programs

  • Maple
    P:=proc(n) local i,k,w,ok,cont; for i from 1 by 1 to n do k:=ithprime(i); w:=0; ok:=1; if k<10 then print(0); else cont:=1; while ok=1 do while k>0 do w:=w+(k-(trunc(k/10)*10)); k:=trunc(k/10); od; if w<10 then ok:=0; print(cont); else cont:=cont+1; k:=w; w:=1; fi; od; fi; od; end: P(100);
  • Mathematica
    Table[Length[NestWhileList[Total[IntegerDigits[#]]&,n,#>9&]]-1,{n, Prime[ Range[100]]}] (* Harvey P. Dale, Aug 05 2014 *)

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

A131840 Additive persistence of Cullen numbers.

Original entry on oeis.org

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

Views

Author

Keywords

Examples

			Cullen number 385 --> 3+8+5=16 -->1+6=7 thus persistence is 2
		

Crossrefs

Programs

  • Maple
    with(numtheory): with(combinat): P:=proc(n) local a,t;t:=0; a:=n*2^n+1; while a>9 do t:=t+1; a:=convert(convert(a,base,10),`+`); od; t;
    end: seq(P(i),i=1..10^2);
  • Mathematica
    f[n_] := Length@ NestWhileList[Plus @@ IntegerDigits@# &, n*2^n + 1, UnsameQ@## &, All] - 2; Array[f, 88] (* James C. McMahon, Mar 01 2025 *)

Formula

a(n) = A031286(A002064(n)). - James C. McMahon, Mar 01 2025

Extensions

Corrected entries and Maple code by Paolo P. Lava, Dec 19 2017

A131841 Additive persistence of Woodall numbers.

Original entry on oeis.org

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

Views

Author

Keywords

Examples

			Woodall number 159 --> 1+5+9=15 --> 1+5=6 thus persistence is 2
		

Crossrefs

Programs

  • Maple
    with(numtheory): with(combinat): P:=proc(n) local a,t;t:=0; a:=n*2^n-1; while a>9 do t:=t+1; a:=convert(convert(a,base,10),`+`); od; t;
    end: seq(P(i),i=1..10^2);
  • Mathematica
    f[n_] := Length@ NestWhileList[Plus @@ IntegerDigits@# &, n*2^n - 1, UnsameQ@## &, All] - 2; Array[f, 88] (* James C. McMahon, Mar 01 2025 *)

Formula

a(n) = A031286(A003261(n)). - James C. McMahon, Mar 01 2025

Extensions

Corrected entries and Maple code by Paolo P. Lava, Dec 19 2017

A316155 Numbers with additive persistence = 4 and digits in nondecreasing order.

Original entry on oeis.org

19999999999999999999999, 28999999999999999999999, 37999999999999999999999, 38899999999999999999999, 46999999999999999999999, 47899999999999999999999, 48889999999999999999999, 55999999999999999999999, 56899999999999999999999, 57799999999999999999999, 57889999999999999999999
Offset: 1

Views

Author

Jaroslav Krizek, Jun 25 2018

Keywords

Comments

All terms of <= 32 digits have digit sum 199. - Robert Israel, Jun 25 2018

Examples

			Repeatedly taking the sum of digits starting with 19999999999999999999999 gives 199, 19, 10 and 1. There are four steps, so the additive persistence is 4 and 19999999999999999999999 is a member.
		

Crossrefs

Programs

  • Maple
    S:= proc(d,t,m) # d digits of sum t with max m
        option remember;
        local j;
      if d*m < t then return [] fi;
      if d = 1 then if t > 0 then return [[t]] else return [] fi fi;
      [seq(op(map(L -> [op(L),j], procname(d-1,t-j,j))),j=1..min(m,t))]
    end proc:
    seq(op(sort(map(t -> add(t[-i]*10^(i-1),i=1..nops(t)), S(d,199,9)))),d=23..24); # Robert Israel, Jun 25 2018

Formula

A031286(a(n)) = 4.

A321909 a(n) is the least base b > 1 in which the additive persistence of n is <= 1.

Original entry on oeis.org

2, 2, 2, 3, 2, 4, 3, 5, 2, 3, 3, 5, 3, 6, 6, 5, 2, 4, 3, 6, 4, 4, 7, 7, 4, 5, 5, 3, 3, 7, 3, 5, 2, 4, 8, 5, 3, 6, 6, 6, 5, 8, 6, 6, 6, 6, 9, 9, 4, 6, 5, 5, 5, 7, 3, 5, 5, 7, 7, 7, 5, 10, 10, 7, 2, 4, 4, 8, 4, 4, 7, 7, 4, 6, 6, 5, 5, 7, 6, 6, 4, 3, 3, 8, 3, 6
Offset: 0

Views

Author

Rémy Sigrist, Nov 21 2018

Keywords

Comments

Equivalently, a(n) is the least base b > 1 in which the sum of digits of n is < b.
The sequence is well defined as, for any n > 0, the additive persistence of n is 0 in base n + 1.
This sequence is unbounded.

Examples

			For n = 42:
- in base 2, 42 has additive persistence 3: "101010" -> "11" -> "10" -> "1",
- in base 3, 42 has additive persistence 2: "1120" -> "11" -> "2",
- in base 4, 42 has additive persistence 2: "222" -> "12" -> "3",
- in base 5, 42 has additive persistence 2: "132" -> "11" -> "2",
- in base 6, 42 has additive persistence 1: "110" -> "2",
- hence a(42) = 6.
		

Crossrefs

See A321882 for a similar sequence.

Programs

  • Mathematica
    Array[Block[{b = 2}, While[Total@ IntegerDigits[#, b] >= b, b++]; b] &, 86, 0] (* Michael De Vlieger, Nov 25 2018 *)
  • PARI
    a(n) = for (b=2, oo, if (sumdigits(n, b) < b, return (b)))

Formula

a(n) = 2 iff n belongs to A131577.
a(n * a(n)) <= a(n).
Previous Showing 11-20 of 25 results. Next