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-2 of 2 results.

A183226 Sum of digits of (2^n) in base 5, also sum of digits of (10^n) in base 5.

Original entry on oeis.org

1, 2, 4, 4, 4, 4, 8, 4, 4, 8, 12, 12, 12, 12, 8, 12, 16, 20, 20, 20, 16, 12, 20, 24, 28, 20, 32, 32, 24, 32, 40, 40, 32, 24, 28, 32, 32, 40, 28, 36, 36, 40, 44, 40, 36, 40, 36, 44, 44, 44, 44, 48, 52, 52, 48, 56, 40, 56, 68, 60, 52, 52, 48, 60, 56, 64, 60, 48, 56, 60, 60, 64, 60, 60, 60, 64, 52, 48, 64, 68, 56, 80, 80
Offset: 0

Views

Author

Washington Bomfim, Jan 01 2011

Keywords

Comments

If i >= 2, a(n) mod 4 = 0. (Cf. A053824)

Examples

			a(9) = 8 because 10^9 = 4022000000000_5, and 2^9 = 512 = 4022_5.
		

Crossrefs

Programs

  • Maple
    a:= n-> add(i, i=convert (2^n, base, 5)):
    seq(a(n), n=0..82);  # Alois P. Heinz, Jan 06 2011
  • Mathematica
    Table[Plus@@IntegerDigits[2^n, 5], {n, 0, 49}] (* Either that one or this one *) Table[Plus@@IntegerDigits[10^n, 5], {n, 0, 49}] (* Alonso del Arte, Jan 06 2011 *)
  • PARI
    \\  L is the list of the N digits of 2^n in quinary.
         \\ L[1] = a_0 , ..., L[N] = a_(N-1).
    convert(n)={n=2^n; x=n; N=floor(log(n)/log(5))+1;
    L = listcreate(N);
    while(x, n=floor(n/5); r=x-5*n; listput(L, r); x=n; );
    L; N};
    for(n=0,100,convert(n);an=0;for(i=1,N,an+=L[i];); print1(an,", "));
    
  • PARI
    t(n) = if(n<1, 0, if(n%5, t(n-1)+1, t(n/5)));
    vector(200, n, n--; t(2^n)) \\ Altug Alkan, Oct 28 2015

A183227 a(n) is the base-5 digit sum of 10^n-1.

Original entry on oeis.org

0, 5, 11, 15, 19, 23, 31, 31, 35, 43, 51, 55, 59, 63, 63, 71, 79, 87, 91, 95, 95, 95, 107, 115, 123, 119, 135, 139, 135, 147, 159, 163, 159, 155, 163, 171, 175, 187, 179, 191, 195, 203, 211, 211, 211, 219, 219, 231, 235, 239
Offset: 0

Views

Author

Washington Bomfim, Jan 01 2011

Keywords

Examples

			a(9) = 43 because 10^9 - 1 is written as 4021444444444_5, and 2^9 - 1 = 511 is written as 4021_5.
		

Crossrefs

Programs

  • Maple
    A053824 := proc(n) add(d,d=convert(n,base,5)) ; end proc:
    A183227 := proc(n) A053824(10^n-1) ; end proc: # R. J. Mathar, Jan 09 2011
  • PARI
    \\L is a list of the N digits of 2^n - 1 in  quinary
    convert(n)={n = 2^n - 1; x=n; N=floor(log(n)/log(5))+1;
    L = listcreate(N);
    while(x, n=floor(n/5); r=x-5*n; listput(L, r); x=n; );
    L; N};
    print1("0, "); for(n = 1,100, convert(n); s = 0; for(i = 1, N, s += L[i];); print1(s+4*n, ", "));

Formula

a(n) = A053824(10^n-1) = 4*n + A053824(2^n-1).
Showing 1-2 of 2 results.