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 21-30 of 32 results. Next

A075543 a(n) = a(n-1) + digit sum(n + 2) with a(0) = 2.

Original entry on oeis.org

2, 5, 9, 14, 20, 27, 35, 44, 45, 47, 50, 54, 59, 65, 72, 80, 89, 99, 101, 104, 108, 113, 119, 126, 134, 143, 153, 164, 167, 171, 176, 182, 189, 197, 206, 216, 227, 239, 243, 248, 254, 261, 269, 278, 288, 299, 311, 324, 329, 335, 342, 350, 359, 369, 380, 392
Offset: 0

Views

Author

Jon Perry, Oct 11 2002

Keywords

Examples

			a(1) = a(0) + digit sum(1 + 2) = 2 + 3 = 5.
		

Crossrefs

Programs

  • Mathematica
    Block[{k = 2}, NestList[# + DigitSum[++k] &, 2, 100]] (* Paolo Xausa, May 24 2024 *)
  • PARI
    c=0; for (n=2,100,c=c+sumdigits(n); print1(c,","))

Extensions

Definition corrected by Georg Fischer, May 22 2024

A138376 a(n+1) = abs[ a(n) + (-1)^(n+1) * Sum_of_digits_of(n+1)], with a(0)=0.

Original entry on oeis.org

0, 1, 3, 0, 4, 1, 7, 0, 8, 1, 2, 0, 3, 1, 6, 0, 7, 1, 10, 0, 2, 1, 5, 0, 6, 1, 9, 0, 10, 1, 4, 0, 5, 1, 8, 0, 9, 1, 12, 0, 4, 1, 7, 0, 8, 1, 11, 0, 12, 1, 6, 0, 7, 1, 10, 0, 11, 1, 14, 0, 6, 1, 9, 0, 10, 1, 13, 0, 14, 1, 8, 0, 9, 1, 12, 0, 13, 1, 16, 0, 8, 1, 11, 0, 12, 1, 15, 0, 16, 1, 10, 0, 11, 1, 14
Offset: 0

Views

Author

Keywords

Comments

a(4*k)=0, with k>=1
a(4*k-2)=1, with k>=1

Crossrefs

Cf. A037123.

Programs

  • Maple
    P:=proc(n) local a,i,k,w; a:=0; print(a); for i from 1 by 1 to n do w:=0; k:=i; while k>0 do w:=w+k-(trunc(k/10)*10); k:=trunc(k/10); od; a:=abs(a+(-1)^i*w); print(a); od; end: P(100);
  • Mathematica
    nxt[{n_,a_}]:={n+1,Abs[a+(-1)^(n+1) Total[IntegerDigits[n+1]]]}; NestList[nxt,{0,0},100][[All,2]] (* Harvey P. Dale, Jan 04 2019 *)

Extensions

Definition corrected by N. J. A. Sloane, Jan 04 2019

A271627 Numbers n such that the sum of the digits of the numbers from 1 to n is a prime.

Original entry on oeis.org

2, 16, 22, 25, 61, 118, 133, 193, 217, 226, 232, 262, 265, 286, 310, 337, 358, 397, 433, 445, 466, 496, 508, 538, 553, 565, 580, 613, 652, 697, 718, 733, 745, 757, 781, 790, 856, 901, 958, 985, 988, 1021, 1093, 1186, 1201, 1210, 1258, 1273, 1285, 1297, 1312, 1321
Offset: 1

Views

Author

Paolo P. Lava, Apr 11 2016

Keywords

Examples

			1 + 2 = 3 that is a prime; 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 1 + 0 + 1 + 1 + 1 + 2 + 1 + 3 + 1 + 4 + 1 + 5 + 1 + 6 = 73 that is a prime.
		

Crossrefs

Programs

  • Maple
    with(numtheory): P:=proc(q) local a,b,c,k,n; a:=0;
    for n from 1 to q do b:=0; c:=n; for k from 1 to ilog10(n)+1 do b:=b+(c mod 10); c:=trunc(c/10); od; a:=a+b;
    if isprime(a) then print(n); fi; od; end: P(10^4);
  • Mathematica
    Select[Range@ 1350, PrimeQ@ Total@ Map[Total@ IntegerDigits@ # &, Range@ #] &] (* Michael De Vlieger, Apr 11 2016 *)
  • PARI
    isok(n) = isprime(sum(k=1, n, sumdigits(k))); \\ Michel Marcus, Apr 11 2016

A271628 Primes that are the sum of the digits of the numbers from 1 to n, for some n.

Original entry on oeis.org

3, 73, 109, 127, 433, 1009, 1117, 1801, 2017, 2089, 2143, 2467, 2503, 2791, 3079, 3331, 3583, 4159, 4519, 4663, 4951, 5437, 5581, 5923, 6121, 6301, 6553, 7039, 7561, 8353, 8623, 8821, 9001, 9199, 9631, 9811, 10837, 11719, 12637, 13177, 13249, 13627, 14401, 15391
Offset: 1

Views

Author

Paolo P. Lava, Apr 11 2016

Keywords

Examples

			The sum of the digits of 1 and 2 is a prime: 1 + 2 = 3.
The sum of the digits of the number from 1 to 16 is a prime: 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 1 + 0 + 1 + 1 + 1 + 2 + 1 + 3 + 1 + 4 + 1 + 5 + 1 + 6 = 73.
		

Crossrefs

Programs

  • Maple
    with(numtheory): P:=proc(q) local a,b,c,k,n; a:=0;
    for n from 0 to q do b:=0; c:=n; for k from 1 to ilog10(n)+1 do b:=b+(c mod 10); c:=trunc(c/10); od; a:=a+b;
    if isprime(a) then print(a); fi; od; end: P(10^6);
  • Mathematica
    Select[Accumulate@ Map[Total@ IntegerDigits@ # &, Range[0, 1200]], PrimeQ] (* Michael De Vlieger, Apr 11 2016 *)
  • PARI
    lista(nn) = for (n=1, nn, if (isprime(p=sum(k=1, n, sumdigits(k))), print1(p, ", "))); \\ Michel Marcus, Apr 11 2016

A316312 Numbers k such that the sum of the digits of the numbers 1, 2, 3, ... up to (k - 1) is divisible by k.

Original entry on oeis.org

1, 3, 5, 7, 9, 12, 15, 20, 27, 40, 45, 60, 63, 80, 81, 100, 180, 181, 300, 360, 363, 500, 540, 545, 700, 720, 727, 900, 909, 912, 915, 1137, 1140, 1200, 1500, 1560, 1563, 2000, 2700, 2720, 2727, 4000, 4500, 4540, 4545, 6000, 6300, 6360, 6363, 8000, 8100, 8180
Offset: 1

Views

Author

Keywords

Comments

Numbers k such that A007953(A007908(k - 1)) is divisible by k. - Felix Fröhlich, Jun 29 2018
From Robert Israel, Jun 29 2018: (Start)
Numbers k such that A037123(k - 1) is divisible by k.
If m is even, then 10^m, 3 * 10^m, 5 * 10^m, 7 * 10^m and 9 * 10^m are included.
If m is odd, then 2 * 10^m, 4 * 10^m, 6 * 10^m, and 8 * 10^m are included. (End)
Is it true that if k is a term then 100 * k is a term?

Examples

			For n = 7, sum of the digits of the numbers 1 to 6 is 21, which is divisible by 7.
For n = 12, sum of the digits of the numbers 1 to 11 is 48, which is divisible by 12.
For n = 15, sum of the digits of the numbers 1 to 14 is 60, which is divisible by 15.
16 is not in the sequence because the sum of the digits of the numbers 1 to 15 is 66, which is not divisible by 16.
		

Crossrefs

Programs

  • Maple
    t:= 0: Res:= NULL:
    for n from 1 to 10000 do
      t:= t + convert(convert(n-1,base,10),`+`);
      if (t/n)::integer then Res:= Res, n fi
    od:
    Res; # Robert Israel, Jun 29 2018
  • Mathematica
    s = 0; Reap[Do[If[Mod[s, n] == 0, Sow[n]]; s += Plus @@ IntegerDigits@n, {n, 10000}]][[2, 1]] (* Giovanni Resta, Jun 29 2018 *)
  • PARI
    sumsod(n) = sum(i=1, n, sumdigits(i))
    is(n) = sumsod(n-1)%n==0 \\ Felix Fröhlich, Jun 29 2018
    
  • PARI
    upto(n) = my(s=0,res=List()); for(i=0, n, s += vecsum(digits(i)); if(s%(i+1)==0, listput(res, i+1))); res \\ David A. Corneth, Jun 29 2018

Extensions

More terms from Felix Fröhlich, Jun 29 2018

A071122 a(n) = a(n-1) + sum of decimal digits of 2^n.

Original entry on oeis.org

2, 6, 14, 21, 26, 36, 47, 60, 68, 75, 89, 108, 128, 150, 176, 201, 215, 234, 263, 294, 320, 345, 386, 423, 452, 492, 527, 570, 611, 648, 695, 753, 815, 876, 935, 999, 1055, 1122, 1193, 1254, 1304, 1350, 1406, 1464, 1526, 1596, 1664, 1737, 1802, 1878, 1958
Offset: 1

Views

Author

Labos Elemer, May 27 2002

Keywords

Crossrefs

Programs

  • Mathematica
    s=0; Do[s=s+Apply[Plus, IntegerDigits[2^n]]; Print[s], {n, 1, 128}]

A071123 a(n) = a(n-1) + sum of decimal digits of n!.

Original entry on oeis.org

1, 3, 9, 15, 18, 27, 36, 45, 72, 99, 135, 162, 189, 234, 279, 342, 405, 459, 504, 558, 621, 693, 792, 873, 945, 1026, 1134, 1224, 1350, 1467, 1602, 1710, 1854, 1998, 2142, 2313, 2466, 2574, 2763, 2952, 3096, 3285, 3465, 3681, 3888, 4104, 4329, 4563, 4788
Offset: 1

Views

Author

Labos Elemer, May 27 2002

Keywords

Crossrefs

Programs

  • Mathematica
    s=0; Do[s=s+Apply[Plus, IntegerDigits[n! ]]; Print[s], {n, 1, 128}]

A099358 a(n) = sum of digits of k^4 as k runs from 1 to n.

Original entry on oeis.org

1, 8, 17, 30, 43, 61, 68, 87, 105, 106, 122, 140, 162, 184, 202, 227, 246, 273, 283, 290, 317, 339, 370, 397, 422, 459, 477, 505, 530, 539, 561, 592, 619, 644, 663, 699, 727, 752, 770, 783, 814, 841, 866, 903, 921, 958, 1001, 1028, 1059, 1072, 1099, 1124, 1161
Offset: 1

Views

Author

Yalcin Aktar, Nov 16 2004

Keywords

Comments

Partial sums of A055565.

Examples

			a(3) = sum_digits(1^4) + sum_digits(2^4) + sum_digits(3^4) = 1 + 7 + 9 = 17.
		

Crossrefs

Cf. k^1 in A037123, k^2 in A071317 & k^3 in A071121.

Programs

  • Mathematica
    f[n_] := Block[{s = 0, k = 1}, While[k <= n, s = s + Plus @@ IntegerDigits[k^4]; k++ ]; s]; Table[ f[n], {n, 50}] (* Robert G. Wilson v, Nov 18 2004 *)
    Accumulate[Table[Total[IntegerDigits[n^4]],{n,60}]] (* Harvey P. Dale, Jun 08 2021 *)

Formula

a(n) = a(n-1) + sum of decimal digits of n^4.
a(n) = sum(k=1, n, sum(m=0, floor(log(k^4)), floor(10((k^4)/(10^(((floor(log(k^4))+1))-m)) - floor((k^4)/(10^(((floor(log(k^4))+1))-m))))))).
General formula: a(n)_p = sum(k=1, n, sum(m=0, floor(log(k^p)), floor(10((k^p)/(10^(((floor(log(k^p))+1))-m)) - floor ((k^p)/(10^(((floor(log(k^p))+1))-m))))))). Here a(n)_p is a sum of digits of k^p from k=1 to n.

Extensions

Edited and extended by Robert G. Wilson v, Nov 18 2004
Existing example replaced with a simpler one by Jon E. Schoenfield, Oct 20 2013

A166352 Table read by rows where row n contains the sorted digits of the integers 0 through n.

Original entry on oeis.org

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

Views

Author

Rick L. Shepherd, Oct 12 2009

Keywords

Comments

A037123(n) is the sum of the terms in row n.

Examples

			Row 10, the sorted digits of 0 through 10, is 0, 0, 1, 1, 2, 3, 4, 5, 6, 7, 8, 9.
		

Crossrefs

Cf. A037123.

Programs

  • Mathematica
    Flatten[Table[Sort[Flatten[IntegerDigits/@Range[0,n]]],{n,0,15}]] (* Harvey P. Dale, Nov 30 2015 *)

A272360 Numbers n such that the sum of the digits of the numbers from 1 to n divides the sum of the numbers from 1 to n.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 80, 119, 180, 398, 399, 998, 999, 1055, 1809, 2715, 4063, 4529, 11374, 18180, 19199, 27269, 54519, 110549, 113695, 168399, 294999, 454511, 624591, 636349, 639999, 1090719, 1818180, 2350079, 9639999, 17576999, 17914111, 54545436, 61484399, 81818169, 91728090, 466359999, 909091519, 909113679, 909156319, 911363679, 915636319, 999999998, 999999999
Offset: 1

Views

Author

Paolo P. Lava, Apr 27 2016

Keywords

Comments

The ratios for the numbers in the list are: 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 7, 10, 19, 19, 37, 37, 40, 67, 97, 136, 151, 325, 505, 526, 737, 1363, 2497, 2584, 3789, 6313, 9469, 12507, 12727, 12784, 20451, 33670, 43214, 154481, 280413, 284734, 814111, 905187
The sequence is infinite, since it contains all the numbers of the form 10^(3^k)-1 and 10^(3^k)-2. For these numbers the ratio is (10^(3^k)-1)/(9*3^k), which is an integer because in general x^(3^k)-1 can be factored into (x-1)(x^2+x+1)(x^6+x^3+1)(x^18+x^9+1)...(x^(2*3^(k-1))+x^(3^(k-1))+1) and since here x=10, x-1=9 and each of the following k factors is divisible by 3 because its sum of digits is 3, thus 10^(3^k)-1 is divisible by 9*3^k. - Giovanni Resta, Apr 27 2016

Examples

			The sum of the digits of the numbers from 1 to 80 is 648; the sum of the numbers from 1 to 80 is 80*81/2 = 3240 and 3240 / 648 = 5
		

Crossrefs

Programs

  • Maple
    P:=proc(q) local b,k; global a,n; a:=0; for n from 1 to q do
    b:=n; for k from 1 to ilog10(n)+1 do a:=a+(b mod 10); b:=trunc(b/10); od;
    if type(n*(n+1)/(2*a),integer) then print(n); fi; od; end: P(10^9);
  • Mathematica
    With[{nn=10^9},Position[Thread[{Accumulate[Range[nn]], Accumulate[ Table[ Total[ IntegerDigits[n]],{n,nn}]]}],?(Divisible[#[[1]],#[[2]]]&), 1,Heads->False]]//Flatten (* _Harvey P. Dale, Sep 30 2017 *)
  • PARI
    list(lim)=my(v=List(),s,t); for(n=1,lim,s+=n; t+=sumdigits(n); if(s%t==0, listput(v,n))); Vec(v) \\ Charles R Greathouse IV, Apr 29 2016

Formula

Solutions for A037123(n) | A000217(n).

Extensions

a(43)-a(52) from Charles R Greathouse IV, Apr 29 2016
Previous Showing 21-30 of 32 results. Next