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

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

Original entry on oeis.org

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

Views

Author

Vladimir Reshetnikov, Nov 24 2010

Keywords

Comments

Except for n = 1, a(n) is also the last nonzero digit of (2^n)!. See the third Bomfim link. - Washington Bomfim, Jan 04 2011

Examples

			a(1) = 8, because (10^1)! = 3628800.
		

Crossrefs

Cf. A008904, final nonzero digit of n!.
Cf. A055476, Powers of ten written in base 5.
Cf. A053824, Sum of digits of n written in base 5.

Programs

  • Mathematica
    f[n_] := If[n > 1, Mod[6Times @@ (Rest[FoldList[{ 1 + #1[[1]], #2!2^(#1[[1]]#2)} &, {0, 0}, Reverse[IntegerDigits[n, 5]]]]), 10][[2]], 1]; Table[ f[10^n], {n, 0, 104}] (* Jacob A. Siehler *)
  • PARI
    \\ L is the list of the N digits of 2^n in base 5.
    \\ 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
    };
    print("0 1");print("1 8");for(n=2,1000,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, Dec 31 2010
    
  • Python
    from functools import reduce
    from sympy.ntheory.factor_ import digits
    def A173670(n): return reduce(lambda x,y:x*y%10,((1,1,2,6,4)[a]*((6,2,4,8)[i*a&3] if i*a else 1) for i, a in enumerate(digits(1<Chai Wah Wu, Dec 07 2023
  • SageMath
    A173670 = lambda n: A008904(10**n)  # D. S. McNeil, Dec 14 2010
    

Formula

From Washington Bomfim, Jan 04 2011: (Start)
a(n) = A008904(10^n).
a(0) = 1, a(1) = 8, if n >= 2, with
2^n represented in base 5 as (a_h, ..., a_1, 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

Extended by D. S. McNeil, Dec 12 2010

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

A055473 Powers of ten written in base 2.

Original entry on oeis.org

1, 1010, 1100100, 1111101000, 10011100010000, 11000011010100000, 11110100001001000000, 100110001001011010000000, 101111101011110000100000000, 111011100110101100101000000000, 1001010100000010111110010000000000, 1011101001000011101101110100000000000
Offset: 0

Views

Author

Henry Bottomley, Jun 27 2000

Keywords

Crossrefs

Programs

  • Mathematica
    FromDigits /@ IntegerDigits[10^Range[0, 9], 2] (* Jayanta Basu, Jul 12 2013 *)
  • PARI
    a(n)=subst(Pol(binary(10^n)),x,10)
    
  • PARI
    a(n) = fromdigits(binary(10^n)); \\ Michel Marcus, Apr 27 2022
    
  • Python
    def a(n): return int(bin(10**n)[2:])
    print([a(n) for n in range(12)]) # Michael S. Branicky, Apr 27 2022

Formula

a(n) = A007088(A011557(n)). - Seiichi Manyama, Apr 27 2022
Showing 1-3 of 3 results.