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.

Showing 1-10 of 10 results.

A014842 Difference between A014837 and A014841.

Original entry on oeis.org

2, 0, 5, 2, 9, 3, 7, 6, 15, 2, 21, 14, 19, 9, 25, 7, 31, 12, 27, 28, 42, 10, 38, 34, 35, 22, 55, 16, 59, 27, 49, 48, 54, 10, 71, 52, 61, 30, 82, 34, 88, 56, 66, 75, 103, 27, 88, 59, 84, 64, 112, 46, 97, 56, 105, 96, 130, 28, 138, 114, 108, 70, 118, 66, 146, 94, 121, 86
Offset: 3

Views

Author

Keywords

A043306 Sum of all digits in all base-b representations for n, for 2 <= b <= n.

Original entry on oeis.org

1, 3, 4, 8, 10, 16, 17, 21, 25, 35, 34, 46, 52, 60, 58, 74, 73, 91, 92, 104, 114, 136, 128, 144, 156, 168, 171, 199, 193, 223, 221, 241, 257, 281, 261, 297, 315, 339, 333, 373, 367, 409, 416, 430, 452, 498, 472, 508, 515, 547, 556, 608, 598, 638, 634, 670, 698, 756, 717, 777
Offset: 2

Views

Author

Keywords

Examples

			5 = 101_2 = 12_3 = 11_4 = 10_5. Thus a(5) = 2 + 3 + 2 + 1 = 8.
		

Crossrefs

Programs

  • Mathematica
    Table[Sum[Total[First[RealDigits[n, i]]], {i, 2, n}], {n, 2, 80}] (* Carl Najafi, Aug 16 2011 *)
  • PARI
    a(n) = sum(i=2, n, vecsum(digits(n, i))); \\ Michel Marcus, Jan 03 2017
    
  • PARI
    a(n) = sum(b=2, n, sumdigits(n, b)); \\ Michel Marcus, Aug 18 2017
    
  • Python
    from sympy.ntheory.digits import digits
    def a(n): return sum(sum(digits(n, b)[1:]) for b in range(2, n+1))
    print([a(n) for n in range(2, 62)]) # Michael S. Branicky, Apr 04 2022

Formula

From Vladimir Shevelev, Jun 03 2011: (Start)
a(n) = (n-1)*n - Sum_{i=2..n} (i-1)*Sum_{r>=1} floor(n/i^r).
a(n) <= (n-1)^2*log(n+1)/log(n).
Problem: find a better upper estimate. (End)
From Amiram Eldar, Apr 16 2021: (Start)
a(n) = A014837(n) + 1.
a(n) ~ (1-Pi^2/12)*n^2 + O(n^(3/2)) (Fissum, 2020). (End)

A014836 Sum modulo n of all the digits of n in every base from 2 to n-1.

Original entry on oeis.org

2, 3, 2, 3, 1, 0, 2, 4, 1, 9, 6, 9, 14, 9, 5, 0, 14, 11, 19, 3, 20, 7, 18, 25, 5, 2, 24, 12, 5, 28, 9, 18, 0, 8, 0, 10, 26, 12, 3, 30, 21, 19, 24, 37, 27, 39, 17, 14, 36, 35, 24, 3, 32, 17, 42, 1, 47, 56, 44, 0, 11, 50, 21, 2, 55, 55, 17, 5, 61, 69, 55, 3, 14, 14, 59, 38, 22, 62
Offset: 3

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    Table[ Mod[Plus@@Table[Plus@@IntegerDigits[n,k],{k,2,n-1}],n],{n,3,100}]

Formula

a(n)=A014837(n) mod n. [From R. J. Mathar, Aug 10 2008]

A014841 Sum modulo the base of all the digits of n in every base from 2 to n-1.

Original entry on oeis.org

0, 3, 2, 7, 6, 13, 13, 18, 19, 31, 24, 37, 40, 48, 48, 65, 59, 79, 76, 85, 93, 117, 105, 121, 132, 148, 143, 176, 163, 193, 191, 208, 226, 250, 225, 262, 277, 302, 290, 332, 320, 359, 363, 376, 394, 444, 419, 455, 462, 491, 495, 551, 540, 577, 564, 601, 625
Offset: 3

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    Table[Sum[Mod[Total[IntegerDigits[n,i]], i], {i,2,n-1}], {n,3,59}] (* Stefano Spezia, Sep 06 2022 *)
  • PARI
    a(n) = sum(b=2, n-1, sumdigits(n, b) % b); \\ Michel Marcus, Sep 06 2022
    
  • Python
    from sympy.ntheory import digits
    def a(n): return sum(sum(digits(n, b)[1:])%b for b in range(2, n))
    print([a(n) for n in range(3, 60)]) # Michael S. Branicky, Sep 06 2022

A014843 Sum modulo n of the sum modulo n of all the digits of n in every base from 2 to n-1.

Original entry on oeis.org

2, 2, 2, 3, 1, 7, 2, 4, 1, 9, 6, 9, 14, 8, 5, 0, 14, 11, 19, 3, 20, 7, 18, 25, 5, 2, 24, 12, 5, 27, 9, 18, 0, 8, 0, 10, 26, 12, 3, 30, 21, 19, 24, 37, 27, 39, 17, 14, 36, 35, 24, 3, 32, 17, 42, 1, 47, 56, 44, 0, 11, 49, 21, 2, 55, 55, 17, 5, 61, 69, 55, 3, 14, 14, 59, 38, 22, 62
Offset: 3

Views

Author

Keywords

Comments

This is a variant of A014836 and A014837. Cf. A116987.

A131383 Total digital sum of n: sum of the digital sums of n for all the bases 1 to n (a 'digital sumorial').

Original entry on oeis.org

1, 3, 6, 8, 13, 16, 23, 25, 30, 35, 46, 46, 59, 66, 75, 74, 91, 91, 110, 112, 125, 136, 159, 152, 169, 182, 195, 199, 228, 223, 254, 253, 274, 291, 316, 297, 334, 353, 378, 373, 414, 409, 452, 460, 475, 498, 545, 520, 557, 565, 598, 608, 661, 652, 693, 690
Offset: 1

Views

Author

Hieronymus Fischer, Jul 05 2007, Jul 15 2007, Jan 07 2009

Keywords

Comments

Sums of rows of the triangle in A138530. - Reinhard Zumkeller, Mar 26 2008

Examples

			5 = 11111(base 1) = 101(base 2) = 12(base 3) = 11(base 4) = 10(base 5). Thus a(5) = ds_1(5)+ds_2(5)+ds_3(5)+ds_4(5)+ds_5(5) = 5+2+3+2+1 = 13.
		

Crossrefs

Programs

  • Mathematica
    Table[n + Total@ Map[Total@ IntegerDigits[n, #] &, Range[2, n]], {n, 56}] (* Michael De Vlieger, Jan 03 2017 *)
  • PARI
    a(n)=sum(i=2,n+1,vecsum(digits(n,i))); \\ R. J. Cano, Jan 03 2017

Formula

a(n) = n^2-sum{k>0, sum{2<=p<=n, (p-1)*floor(n/p^k)}}.
a(n) = n^2-sum{2<=p<=n, (p-1)*sum{0
a(n) = n^2-A024916(n)+A006218(n)-sum{k>1, sum{2<=p<=n, (p-1)*floor(n/p^k)}}.
a(n) = A004125(n)+A006218(n)-sum{k>1, sum{2<=p<=n, (p-1)*floor(n/p^k)}}.
Asymptotic behavior: a(n) = (1-Pi^2/12)*n^2 + O(n*log(n)) = A004125(n) + A006218(n) + O(n*log(n)).
Lim a(n)/n^2 = 1 - Pi^2/12 for n-->oo.
G.f.: (1/(1-x))*(x(1+x)/(1-x)^2-sum{k>0,sum{j>1,(j-1)*x^(j^k)/(1-x^(j^k))}= }).
Also: (1/(1-x))*(x(1+x)/(1-x)^2-sum{m>1, sum{10,j^(1/k) is an integer, j^(1/k)-1}}*x^m}).
a(n) = n^2-sum{10,sum{1
Recurrence: a(n)=a(n-1)-b(n)+2n-1, where b(n)=sum{1
a(n) = sum{1<=p<=n, ds_p(n)} where ds_p = digital sum base p.
a(n) = A043306(n) + n (that sequence ignores unary) = A014837(n) + n + 1 (that sequence ignores unary and base n in which n is "10"). - Alonso del Arte, Mar 26 2009

A014840 Sum of all the digits of n in every base prime to n from 2 to n-1.

Original entry on oeis.org

2, 2, 7, 2, 15, 10, 15, 8, 34, 12, 45, 22, 31, 32, 73, 28, 90, 40, 57, 50, 135, 46, 118, 74, 117, 70, 198, 58, 222, 120, 139, 122, 192, 92, 296, 152, 216, 136, 372, 112, 408, 202, 235, 208, 497, 176, 442, 224, 338, 260, 607, 202, 454, 276, 416, 330, 755, 194, 776
Offset: 3

Keywords

Programs

  • Maple
    f:= proc(n) local b;
     add(convert(convert(n,base,b),`+`), b = select(t -> igcd(t,n)=1, [$2..n-1]))
    end proc:
    map(f, [$3..100]); # Robert Israel, Nov 08 2024
  • Mathematica
    Table[Sum[If[CoprimeQ[i, n], Mod[Total[IntegerDigits[n, i]], n], 0], {i, 2, n-1}], {n, 3, 61}] (* Stefano Spezia, Sep 06 2022 *)
  • PARI
    a(n) = {s = 0; for (i=2, n-1, if (gcd(i, n) == 1, d = digits(n, i); s += sum(j=1, #d, d[j]););); s;} \\ Michel Marcus, May 30 2014
    
  • Python
    from math import gcd
    from sympy.ntheory import digits
    def a(n): return sum(sum(digits(n, b)[1:]) for b in range(2, n) if gcd(b, n) == 1)
    print([a(n) for n in range(3, 62)]) # Michael S. Branicky, Sep 06 2022

A014838 Sum of all the digits of n in every prime base from 2 to n-1.

Original entry on oeis.org

2, 3, 5, 6, 9, 11, 11, 10, 14, 16, 21, 21, 21, 23, 29, 32, 39, 42, 42, 39, 47, 52, 53, 49, 52, 53, 62, 66, 76, 83, 82, 76, 77, 82, 93, 87, 85, 90, 102, 107, 120, 123, 129, 120, 134, 144, 147, 153, 150, 151, 166, 176, 178, 185, 181, 168, 184, 194, 211, 199, 207
Offset: 3

Keywords

Programs

  • Mathematica
    Table[Sum[If[PrimeQ[i], Mod[Total[IntegerDigits[n, i]], n], 0], {i, 2, n-1}],{n, 3, 63}] (* Stefano Spezia, Sep 06 2022 *)
  • PARI
    a(n) = {s = 0; forprime (i=2, n-1, d = digits(n, i); s += sum(j=1, #d, d[j]);); s;} \\ Michel Marcus, May 30 2014
    
  • Python
    from sympy.ntheory import digits, isprime
    def a(n): return sum(sum(digits(n, b)[1:]) for b in range(2, n) if isprime(b))
    print([a(n) for n in range(3, 64)]) # Michael S. Branicky, Sep 06 2022

A014839 Sum of all the digits of n in every prime-power base from 2 to n-1.

Original entry on oeis.org

2, 3, 7, 9, 13, 13, 16, 19, 26, 28, 36, 39, 42, 34, 45, 44, 55, 59, 63, 64, 76, 75, 80, 82, 82, 87, 102, 112, 128, 113, 120, 121, 129, 130, 148, 149, 154, 156, 175, 187, 207, 214, 219, 217, 238, 227, 237, 228, 233, 239, 262, 246, 256, 261, 265, 260, 284, 299
Offset: 3

Keywords

Programs

  • Mathematica
    Table[Sum[If[PrimePowerQ[i], Mod[Total[IntegerDigits[n, i]], n], 0], {i, 2, n-1}], {n, 3, 60}] (* Stefano Spezia, Sep 06 2022 *)

A343481 a(n) is the sum of all digits of n in every prime base 2 <= p <= n.

Original entry on oeis.org

1, 3, 3, 6, 6, 10, 11, 11, 10, 15, 16, 22, 21, 21, 23, 30, 32, 40, 42, 42, 39, 48, 52, 53, 49, 52, 53, 63, 66, 77, 83, 82, 76, 77, 82, 94, 87, 85, 90, 103, 107, 121, 123, 129, 120, 135, 144, 147, 153, 150, 151, 167, 176, 178, 185, 181, 168, 185, 194, 212, 199
Offset: 2

Author

Amiram Eldar, Apr 16 2021

Keywords

Examples

			a(5) = 6 since in the prime bases 2, 3 and 5 the representations of 5 are 101_2, 12_3 and 10_5, respectively, and (1 + 0 + 1) + (1 + 2) + (1 + 0) = 6.
		

Crossrefs

Programs

  • Mathematica
    s[n_, b_] := Plus @@ IntegerDigits[n, b]; ps[n_] := Select[Range[n], PrimeQ]; a[n_] := Sum[s[n, b], {b, ps[n]}]; Array[a, 100, 2]
  • PARI
    a(n) = sum(b=2, n, if (isprime(b), sumdigits(n, b))); \\ Michel Marcus, Apr 17 2021

Formula

a(n) ~ (1-Pi^2/12)*n^2/log(n) + c*n^2/log(n)^2 + o(n^2/log(n)^2), where c = 1 - Pi^2/24 + zeta'(2)/2 = 1 - A222171 - (1/2)*A073002 = 0.1199923561... (Fissum, 2020).
Showing 1-10 of 10 results.