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

A037123 a(n) = a(n-1) + sum of digits of n.

Original entry on oeis.org

0, 1, 3, 6, 10, 15, 21, 28, 36, 45, 46, 48, 51, 55, 60, 66, 73, 81, 90, 100, 102, 105, 109, 114, 120, 127, 135, 144, 154, 165, 168, 172, 177, 183, 190, 198, 207, 217, 228, 240, 244, 249, 255, 262, 270, 279, 289, 300, 312, 325, 330, 336, 343, 351, 360, 370, 381
Offset: 0

Views

Author

Vasiliy Danilov (danilovv(AT)usa.net), Jun 15 1998

Keywords

Comments

Sum of digits of A007908(n). - Franz Vrabec, Oct 22 2007
Also digital sum of A138793(n) for n > 0. - Bruno Berselli, May 27 2011
Sum of the digital sum of i for i from 0 to n. - N. J. A. Sloane, Nov 13 2013

References

  • N. Agronomof, Sobre una función numérica, Revista Mat. Hispano-Americana 1 (1926), 267-269.
  • Maurice d'Ocagne, Sur certaines sommations arithmétiques, J. Sciencias Mathematicas e Astronomicas 7 (1886), 117-128.

Crossrefs

Cf. also A074784, A231688, A231689.
Partial sums of A007953.

Programs

  • Magma
    [ n eq 0 select 0 else &+[&+Intseq(k): k in [0..n]]: n in [0..56] ];  // Bruno Berselli, May 27 2011
  • Maple
    # From N. J. A. Sloane, Nov 13 2013:
    digsum:=proc(n,B) local a; a := convert(n, base, B):
    add(a[i], i=1..nops(a)): end;
    f:=proc(n,k,B) global digsum; local i;
    add( digsum(i,B)^k,i=0..n); end;
    lprint([seq(digsum(n,10),n=0..100)]); # A007953
    lprint([seq(f(n,1,10),n=0..100)]); #A037123
    lprint([seq(f(n,2,10),n=0..100)]); #A074784
    lprint([seq(f(n,3,10),n=0..100)]); #A231688
    lprint([seq(f(n,4,10),n=0..100)]); #A231689
  • Mathematica
    Table[Plus@@Flatten[IntegerDigits[Range[n]]], {n, 0, 200}] (* Enrique Pérez Herrero, Oct 12 2015 *)
    a[0] = 0; a[n_] := a[n - 1] + Plus @@ IntegerDigits@ n; Array[a, 70, 0] (* Robert G. Wilson v, Jul 06 2018 *)
  • PARI
    a(n)=n*(n+1)/2-9*sum(k=1,n,sum(i=1,ceil(log(k)/log(10)),floor(k/10^i)))
    
  • PARI
    a(n)={n++;my(t,i,s);c=n;while(c!=0,i++;c\=10);for(j=1,i,d=(n\10^(i-j))%10;t+=(10^(i-j)*(s*d+binomial(d,2)+d*9*(i-j)/2));s+=d);t} \\ David A. Corneth, Aug 16 2013
    
  • Perl
    for $i (0..100){ @j = split "", $i; for (@j){ $sum += $; } print "$sum,"; } __END_ # gamo(AT)telecable.es
    

Formula

a(n) = Sum_{k=0..n} s(k) = Sum_{k=0..n} A007953(k), where s(k) denote the sum of the digits of k in decimal representation. Asymptotic expression: a(n-1) = Sum_{k=0..n-1} s(k) = 4.5*n*log_10(n) + O(n). - Antonio G. Astudillo (afg_astudillo(AT)hotmail.com), Sep 07 2002
a(n) = n*(n+1)/2 - 9*Sum_{k=1..n} Sum_{i=1..ceiling(log_10(k))} floor(k/10^i). - Benoit Cloitre, Aug 28 2003
From Hieronymus Fischer, Jul 11 2007: (Start)
G.f.: Sum_{k>=1} ((x^k - x^(k+10^k) - 9x^(10^k))/(1-x^(10^k)))/(1-x)^2.
a(n) = (1/2)*((n+1)*(n - 18*Sum_{k>=1} floor(n/10^k)) + 9*Sum_{k>=1} (1 + floor(n/10^k))*floor(n/10^k)*10^k).
a(n) = (1/2)*((n+1)*(2*A007953(n)-n) + 9*Sum_{k>=1} (1+floor(n/10^k))*floor(n/10^k)*10^k). (End)
a(n) = A007953(A053064(n)). - Reinhard Zumkeller, Oct 10 2008
From Wojciech Raszka, Jun 14 2019: (Start)
a(10^k - 1) = 10*a(10^(k - 1) - 1) + 45*10^(k - 1) for k > 0.
a(n) = a(n mod m) + MSD*a(m - 1) + (MSD*(MSD - 1)/2)*m + MSD*((n mod m) + 1), where m = 10^(A055642(n) - 1), MSD = A000030(n). (End)

Extensions

More terms from Antonio G. Astudillo (afg_astudillo(AT)hotmail.com), Sep 07 2002

A037308 Numbers whose base-2 and base-10 expansions have the same digit sum.

Original entry on oeis.org

0, 1, 20, 21, 122, 123, 202, 203, 222, 223, 230, 231, 302, 303, 410, 411, 502, 503, 1130, 1131, 1150, 1151, 1202, 1203, 1212, 1213, 1230, 1231, 1300, 1301, 1402, 1403, 1502, 1503, 1510, 1511, 2006, 2007, 2032, 2033, 2102, 2103, 2200, 2201, 3006, 3007, 3012
Offset: 1

Views

Author

Keywords

Comments

n is in the sequence iff n+(-1)^n is in the sequence. [Robert Israel, Mar 25 2013]

Examples

			122 is a member, since digital-sum_2(122) = 5 = digital-sum_10(122).
		

Crossrefs

Programs

  • Maple
    N:= 10000; # to get all elements up to N
    select(x -> (convert(convert(x,base,10),`+`)-convert(convert(x,base,2),`+`)=0), [$0..N]); # Robert Israel, Mar 25 2013
  • Mathematica
    Select[Range[0, 5000], Total[IntegerDigits[#, 2]] == Total[IntegerDigits[#, 10]] &] (* Jean-François Alcover, Mar 07 2016 *)
  • PARI
    is(n)=hammingweight(n)==sumdigits(n); \\ Charles R Greathouse IV, Sep 25 2012
    
  • Python
    def ok(n): return sum(map(int, str(n))) == sum(map(int, bin(n)[2:]))
    print(list(filter(ok, range(3013)))) # Michael S. Branicky, Jun 20 2021
  • Sage
    [n for n in (0..10000) if sum(n.digits(base=2)) == sum(n.digits(base=10))] # Freddy Barrera, Oct 12 2018
    

Formula

From Reinhard Zumkeller, Aug 06 2010: (Start)
A007953(a(n)) = A000120(a(n));
A180018(a(n)) = 0. (End)

Extensions

Edited by N. J. A. Sloane Nov 29 2008 at the suggestion of Zak Seidov

A135120 Numbers such that the digital sum base 2 and the digital sum base 3 and the digital sum base 10 all are equal.

Original entry on oeis.org

1, 21, 222, 223, 1230, 1231, 1502, 2200, 2201, 3012, 3013, 10431, 12214, 12215, 12250, 12251, 14102, 15003, 15021, 16011, 20040, 20041, 22130, 23211, 23230, 23231, 24003, 30070, 30071, 30105, 30231, 30321, 31005, 31150, 31151, 31420
Offset: 1

Views

Author

Hieronymus Fischer, Dec 24 2007

Keywords

Examples

			a(2)=21, since ds_2(21)=ds_3(21)=ds_10(21)=3.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[5000], Total[IntegerDigits[#, 2]] == Total[IntegerDigits[#, 3]] ==  Total[IntegerDigits[#, 10]] &] (* G. C. Greubel, Sep 26 2016 *)
  • PARI
    is(n)=my(t=sumdigits(n)); t==hammingweight(n) && t==sumdigits(n,3) \\ Charles R Greathouse IV, Sep 26 2016

A135100 Numbers which divide their digital sumorial (see A131383).

Original entry on oeis.org

1, 3, 4, 15, 26, 2573, 17226, 19786, 22083, 58133, 67693, 223657, 376460, 464713, 497068, 2621204, 4553376, 6000136, 7671158, 13975944, 14074903, 52731198, 82594577
Offset: 1

Views

Author

Hieronymus Fischer, Dec 24 2007

Keywords

Examples

			a(5)=26, since 26 divides its digital sumorial, which is A131383(26)=182.
		

Crossrefs

Programs

  • PARI
    a=1;for(n=2,10^6,if(a%(n-1)==0,print1(n-1","));x=divisors(n);L=numdiv(n);a+=n; for(i=2,L-1,d=x[i];k=n;while(k%d==0,a-=d-1;k\=d))) \\ Robert Gerbicz, May 09 2008

Extensions

a(12)-a(15) from Robert Gerbicz, May 09 2008
a(16)-a(23) from Hieronymus Fischer, Jul 31 2008

A135121 Numbers such that the digital sum base 2 and the digital sum base 3 and the digital sum base 5 all are equal.

Original entry on oeis.org

0, 1, 6, 7, 10, 11, 60, 61, 180, 181, 285, 300, 301, 575, 687, 754, 826, 827, 882, 883, 900, 901, 910, 911, 1254, 1305, 1311, 1326, 1327, 1335, 1377, 1383, 1386, 1387, 1395, 1431, 1506, 1507, 1532, 1626, 1627, 1650, 1651, 1890, 1891, 1955, 2013, 2036, 2040
Offset: 1

Views

Author

Hieronymus Fischer, Dec 31 2007

Keywords

Examples

			a(2)=6, since ds_2(6)=ds_3(6)=ds_5(6), where ds_x=digital sum base x.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[0,3000],Length[Union[Total/@IntegerDigits[#,{2,3,5}]]]==1&] (* Harvey P. Dale, Sep 04 2014 *)

Extensions

Added 0, Stanislav Sykora, May 06 2012

A135127 Numbers such that the digital sums in bases 2, 3, 5 and 7 all are equal.

Original entry on oeis.org

0, 1, 882, 883, 1386, 1387, 2502, 2503, 3453, 7555, 7652, 7665, 7931, 9751, 10101, 12250, 12251, 16893, 17010, 17011, 17515, 17550, 17551, 18285, 20301, 22050, 22051, 24406, 24407, 25053, 27503, 31654, 40930, 40931, 41951, 50878, 50879
Offset: 1

Views

Author

Hieronymus Fischer, Dec 31 2007

Keywords

Examples

			a(2)=882, since ds_2(882 )=ds_3(882 )=ds_5(882 )=ds_7(882 )=6, where ds_x=digital sum base x.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[0, 32000], Total[IntegerDigits[#, 2]] == Total[IntegerDigits[#, 3]] == Total[IntegerDigits[#, 5]] == Total[IntegerDigits[#, 7]] &] (* G. C. Greubel, Sep 27 2016 *)
    Select[Range[0,51000],Length[Union[Total/@IntegerDigits[#,{2,3,5,7}]]] == 1&] (* Harvey P. Dale, Sep 18 2019 *)

Extensions

Added 0, Stanislav Sykora, May 06 2012

A135122 Numbers such that the digital sum base 2 and the digital sum base 3 and the digital sum base 4 all are equal.

Original entry on oeis.org

1, 21, 261, 273, 17748, 17749, 20820, 20821, 65620, 65621, 70740, 70741, 83268, 83269, 86292, 86293, 1066068, 1066069, 1070420, 1135701, 1135893, 1135953, 5326161, 5330001, 5330241, 5330260, 5330261, 5506389, 5525829, 5526801, 5571909, 5574933, 5592321
Offset: 1

Views

Author

Hieronymus Fischer, Dec 31 2007

Keywords

Examples

			a(2)=21, since ds_2(21)=ds_3(21)=ds_10(21)=3, where ds_x=digital sum base x.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[5600000],Length[Union[Table[Total[IntegerDigits[#,n]],{n,2,4}]]]==1&] (* Harvey P. Dale, Aug 14 2013 *)
  • PARI
    isok(n) = my(sd2=sumdigits(n, 2)); (sd2==sumdigits(n, 3)) && (sd2==sumdigits(n, 4)); \\ Michel Marcus, Aug 08 2018

Extensions

a(31)-a(33) from Giovanni Resta, Aug 06 2018

A135101 Digital sum (base the n-th prime) of n^n.

Original entry on oeis.org

1, 2, 3, 10, 15, 24, 55, 46, 71, 116, 101, 180, 213, 196, 205, 276, 307, 444, 337, 610, 621, 646, 687, 808, 985, 876, 921, 996, 1049, 1184, 1417, 1576, 1665, 1576, 2127, 1836, 2377, 1660, 2201, 2088, 2731, 2844, 2847, 2944, 3317, 3232, 3503, 3294, 3165
Offset: 1

Views

Author

Hieronymus Fischer, Dec 24 2007

Keywords

Examples

			a(2) = ds_prime(2)(2^2) = ds_3(4) = 1+1 = 2;
a(10) = ds_prime(5)(5^5) = ds_11(3125) = 2+3+9+1 = 15.
		

Crossrefs

Programs

  • Mathematica
    Table[Total[IntegerDigits[n^n, Prime[n]]], {n, 50}] (* G. C. Greubel, Sep 23 2016 *)
  • PARI
    a(n) = vecsum(digits(n^n, prime(n))); \\ Michel Marcus, Sep 24 2016

Formula

a(n) = ds_prime(n)(n^n), where ds_prime(n) = digital sum base the n-th prime.
a(n) = n^n - (prime(n)-1)*Sum{k>0} ( floor(n^n/prime(n)^k) ).

A135102 Digital sum (base the n-th prime) of Fibonacci(n).

Original entry on oeis.org

1, 1, 2, 3, 5, 8, 13, 3, 12, 27, 29, 36, 33, 41, 58, 51, 31, 64, 89, 45, 74, 83, 39, 168, 145, 193, 170, 129, 149, 104, 211, 289, 274, 175, 257, 252, 125, 161, 318, 347, 447, 316, 317, 285, 450, 107, 253, 648, 363, 301, 498, 409, 773, 522, 429, 515, 782, 649, 641
Offset: 1

Views

Author

Hieronymus Fischer, Dec 24 2007

Keywords

Examples

			a(2) = ds_prime(2)(Fib(2)) = ds_3(1) = 1;
a(10) = ds_prime(10)(55) = ds_29(55) = 1+26 = 27.
		

Crossrefs

Programs

  • Mathematica
    Table[Total[IntegerDigits[Fibonacci[n],Prime[n]]],{n,60}] (* Harvey P. Dale, May 05 2013 *)
  • PARI
    a(n) = vecsum(digits(fibonacci(n), prime(n))); \\ Michel Marcus, Sep 24 2016

Formula

a(n) = ds_prime(n)(Fib(n)), where ds_prime(n) = digital sum base the n-th prime.
a(n) = Fibonacci(n) - (prime(n)-1)*Sum{k>0} ( floor(Fibonacci(n)/prime(n)^k) ).

A135103 Digital sum (base the n-th prime) of n^3.

Original entry on oeis.org

1, 4, 3, 4, 5, 12, 7, 26, 25, 20, 41, 36, 37, 56, 63, 40, 41, 72, 61, 90, 117, 118, 113, 96, 73, 76, 99, 116, 89, 120, 181, 138, 169, 112, 251, 156, 109, 116, 57, 188, 35, 108, 87, 128, 181, 118, 83, 258, 129, 284, 179, 188, 317, 214, 231, 338, 273, 442, 311, 400, 253
Offset: 1

Views

Author

Hieronymus Fischer, Dec 24 2007

Keywords

Examples

			a(2)=ds_prime(2)(2^3)=ds_3(8)=2+2=4; a(6)=ds_prime(6)(6^3)=ds_13(216)=1+3+8=12.
		

Crossrefs

Programs

  • Mathematica
    Table[Total[IntegerDigits[n^3,Prime[n]]],{n,70}] (* Harvey P. Dale, Oct 21 2011 *)

Formula

a(n)=ds_prime(n)(n^3), where ds_prime(n)=digital sum base the n-th prime.
a(n)=n^3-(prime(n)-1)*sum{k>0, floor(n^3/prime(n)^k)}.
Showing 1-10 of 21 results. Next