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

A053824 Sum of digits of (n written in base 5).

Original entry on oeis.org

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

Views

Author

Henry Bottomley, Mar 28 2000

Keywords

Comments

Also the fixed point of the morphism 0->{0,1,2,3,4}, 1->{1,2,3,4,5}, 2->{2,3,4,5,6}, etc. - Robert G. Wilson v, Jul 27 2006

Examples

			a(20) = 4 + 0 = 4 because 20 is written as 40 in base 5.
From _Omar E. Pol_, Feb 21 2010: (Start)
It appears that this can be written as a triangle:
  0,
  1,2,3,4,
  1,2,3,4,5,2,3,4,5,6,3,4,5,6,7,4,5,6,7,8,
  1,2,3,4,5,2,3,4,5,6,3,4,5,6,7,4,5,6,7,8,5,6,7,8,9,2,3,4,5,6,3,4,5,6,7,4,5,...
See the conjecture in the entry A000120. (End)
		

Crossrefs

Sum of digits of n written in bases 2-16: A000120, A053735, A053737, this sequence, A053827, A053828, A053829, A053830, A007953, A053831, A053832, A053833, A053834, A053835, A053836.
Cf. A173525. - Omar E. Pol, Feb 21 2010
Cf. A173670 (last nonzero decimal digit of (10^n)!). - Washington Bomfim, Jan 01 2011

Programs

  • Haskell
    a053824 0 = 0
    a053824 x = a053824 x' + d  where (x', d) = divMod x 5
    -- Reinhard Zumkeller, Jan 31 2014
    
  • Magma
    [&+Intseq(n, 5):n in [0..100]]; // Marius A. Burtea, Aug 24 2019
  • Mathematica
    Table[Plus @@ IntegerDigits[n, 5], {n, 0, 100}] (* or *)
    Nest[Flatten[ #1 /. a_Integer -> Table[a + i, {i, 0, 4}]] &, {0}, 4] (* Robert G. Wilson v, Jul 27 2006 *)
    f[n_] := n - 4 Sum[Floor[n/5^k], {k, n}]; Array[f, 103, 0]
  • PARI
    a(n)=if(n<1,0,if(n%5,a(n-1)+1,a(n/5)))
    
  • PARI
    a(n) = sumdigits(n, 5); \\ Michel Marcus, Aug 24 2019
    

Formula

From Benoit Cloitre, Dec 19 2002: (Start)
a(0) = 0, a(5n+i) = a(n) + i for 0 <= i <= 4;
a(n) = n - 4*Sum_{k>=1} floor(n/5^k) = n - 4*A027868(n). (End)
a(n) = A138530(n,5) for n > 4. - Reinhard Zumkeller, Mar 26 2008
If i >= 2, a(2^i) mod 4 = 0. - Washington Bomfim, Jan 01 2011
a(n) = Sum_{k>=0} A031235(n,k). - Philippe Deléham, Oct 21 2011
a(0) = 0; a(n) = a(n - 5^floor(log_5(n))) + 1. - Ilya Gutkovskiy, Aug 23 2019
Sum_{n>=1} a(n)/(n*(n+1)) = 5*log(5)/4 (Shallit, 1984). - Amiram Eldar, Jun 03 2021

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

A132826 Decimal expansion of the integer Googol!.

Original entry on oeis.org

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

Views

Author

Martin Raab, Nov 18 2007, Dec 11 2007

Keywords

Comments

The number in question has 9956570551809674817234887108108339491770560299419 \ 63334338855462168341353507911292252707750506615682568 digits and ends in exactly 10^101/8 - 18 zeros. - Robert G. Wilson v, Jan 09 2013
The last nonzero term of this sequence is 6. - Washington Bomfim, Dec 24 2010

References

  • Ronald L. Graham, Donald E. Knuth and Oren Patashnik, Concrete Math.; section 4, exercises 40, and 54.

Crossrefs

Programs

  • Mathematica
    f[n_] := 10^FractionalPart[N[(n*Log[n] - n + (1/2)*Log[(2*n + 1/3)*Pi])/Log[10], 203]]; RealDigits[ f[10^100], 10, 101][[1]] (* Robert G. Wilson v, Jan 09 2013 *)

Formula

10^100! = 1*2*3*4*...*(10^100-1)*10^100.

A178969 Last nonzero decimal digit of (10^10^n)!.

Original entry on oeis.org

8, 2, 6, 4, 2, 2, 6, 2, 6, 4, 2, 2
Offset: 0

Views

Author

Robert G. Wilson v, Jan 01 2011

Keywords

Comments

It is possible to find a(10) using the program from the second Bomfim link, or a similar GMP program. Reserve 312500001 words instead of 31250001. Use a computer with at least 6 GB of RAM. - Washington Bomfim, Jan 06 2011

Crossrefs

Programs

  • Mathematica
    f[n_] := Mod[6Times @@ (Rest[FoldList[{ 1 + #1[[1]], #2!2^(#1[[1]]#2)} &, {0, 0}, Reverse[IntegerDigits[n, 5]]]]), 10][[2]]; (* Jacob A. Siehler *) Table[ f[10^10^n], {n, 0, 4}]
  • PARI
    \\ L is the list of the N digits of 2^(10^n) in base 5.
    \\ With 2^(10^n) in base 5 as (a_h, ... , a_0)5,
    \\ L[1] = a_0, ... ,L[N] = a_h.
    convert(n)={n=2^(10^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
    };
    print("0 8"); for(n=1, 5, print1(n, " "); convert(n); q=0; t=0; x=0; forstep(i=N, 2, -1, a_i=L[i]; q+=a_i; x+=q; t+=a_i*(1-a_i%2); ); a_i=L[1]; t+=a_i*(1-a_i%2); z=(x+t/2)%4; y=2^z; an=6*(y%2)+y*(1-(y%2)); print(an)); \\ Washington Bomfim, Jan 06 2011
    
  • Python
    from functools import reduce
    from sympy.ntheory.factor_ import digits
    def A178969(n): return reduce(lambda x,y:x*y%10,(((6,2,4,8,6,2,4,8,2,4,8,6,6,2,4,8,4,8,6,2)[(a<<2)|(i*a&3)] if i*a else (1,1,2,6,4)[a]) for i, a in enumerate(sympydigits(1<<10**n,5)[-1:0:-1])),6) if n else 8 # Chai Wah Wu, Dec 07 2023

Formula

From Washington Bomfim, Jan 06 2011: (Start)
a(n) = A008904(10^(10^n)).
a(n) = A008904(2^(10^n)), if n > 0.
For n >= 1, with N = 10^n, 2^N represented in base 5 as (a_h, ..., a_0)5, t = Sum{i = h, h-1, ..., 0} (a_i even), x = Sum_{i = h, h-1, ..., 1}(Sum_{k = h, h-1, ..., i} (a_i)), z = (x + t/2) mod 4, and y = 2^z, a(n) = 6*(y mod 2) + y*(1 - (y mod 2)).
(End)

Extensions

a(9) from Washington Bomfim, Jan 06 2011
a(10) from Chai Wah Wu, Dec 07 2023
a(11) from Chai Wah Wu, Dec 08 2023
Showing 1-4 of 4 results.