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 11-20 of 31 results. Next

A136699 Final nonzero digit of n! in base 13.

Original entry on oeis.org

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

Views

Author

Carl R. White, Jan 16 2008

Keywords

Examples

			6! = 720 decimal = 435 tridecimal, so a(6) = 5.
		

Crossrefs

Programs

  • Mathematica
    f[s_List] := Block[{a = s[[ -1]], len = Length@s}, Append[s, If[Mod[len, 13] == 0, Mod[a*len/13,13], Mod[a*len, 13]]]]; Nest[f, {1}, 100] (* Robert G. Wilson v, May 03 2009 *)
    f[n_] := Block[{id = IntegerDigits[n!, 13]}, While[id[[ -1]] == 0, id = Most@id]; id[[ -1]]]; Table[ f@n, {n, 0, 100}] (* Robert G. Wilson v, May 03 2009 *)

A136701 Final nonzero digit of n! in base 15.

Original entry on oeis.org

1, 1, 2, 6, 9, 8, 3, 6, 3, 12, 3, 3, 6, 3, 12, 12, 12, 9, 12, 3, 9, 9, 3, 9, 6, 9, 9, 3, 9, 6, 12, 12, 9, 12, 3, 12, 12, 9, 12, 3, 3, 3, 6, 3, 12, 6, 6, 12, 6, 9, 12, 12, 9, 12, 3, 6, 6, 12, 6, 9, 6, 6, 12, 6, 9, 9, 9, 3, 9, 6, 3, 3, 6, 3, 12, 9, 9, 3, 9, 6, 12, 12, 9, 12, 3, 12, 12, 9, 12, 3, 3, 3, 6
Offset: 0

Views

Author

Carl R. White, Jan 16 2008

Keywords

Comments

From Robert Israel, Jun 08 2018: (Start)
For n >= 6, a(n) is 3, 6, 9 or 12.
For k >= 2, a(5*k) = a(5*k+1) = a(5*k+3). (End)

Examples

			6! = 720 decimal = 330 quindecimal, so a(6) = 3.
		

Crossrefs

Programs

  • Maple
    a:= 1: b:= 0: R[0]:= 1:
    for n from 1 to 100 do
       alpha:= padic:-ordp(n,3);
       beta:= padic:-ordp(n,5);
       a:= a * n/3^alpha/5^beta;
       b:= b + alpha - beta;
       R[n]:= a * 3 &^ b mod 15;
    od:
    seq(R[n],n=0..100); # Robert Israel, Jun 08 2018
  • Mathematica
    nzd[x_]:=If[x[[-1,1]]==0,x[[-2,1]],x[[-1,1]]]; Table[nzd[Split[IntegerDigits[n!,15]]],{n,0,100}] (* Harvey P. Dale, Jul 11 2023 *)

A136702 Final nonzero digit of n! in base 16.

Original entry on oeis.org

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

Views

Author

Carl R. White, Jan 16 2008

Keywords

Examples

			6! = 720 decimal = 2D0 hexadecimal, so a(6) = 13.
		

Crossrefs

Programs

  • PARI
    a(n) = {d = digits(n!, 16); k = #d; while (!d[k] && (k!=1), k--); d[k];} \\ Michel Marcus, Sep 21 2016

A136693 Final nonzero digit of n! in base 6.

Original entry on oeis.org

1, 1, 2, 1, 4, 2, 2, 2, 4, 4, 4, 2, 4, 4, 2, 2, 2, 4, 2, 2, 4, 2, 2, 4, 4, 4, 2, 4, 4, 2, 4, 4, 2, 2, 2, 4, 4, 4, 2, 4, 4, 2, 2, 2, 4, 2, 2, 4, 2, 2, 4, 4, 4, 2, 2, 2, 4, 2, 2, 4, 4, 4, 2, 2, 2, 4, 2, 2, 4, 4, 4, 2, 4, 4, 2, 4, 4, 2, 2, 2, 4, 4, 4, 2, 4, 4, 2, 2, 2, 4, 4, 4, 2, 4, 4, 2, 2, 2, 4, 2
Offset: 0

Views

Author

Carl R. White, Jan 16 2008

Keywords

Examples

			6! = 720 decimal = 3200 senary, so a(6) = 2.
		

Crossrefs

Programs

  • Mathematica
    nzd6[n_]:=Module[{c=IntegerExponent[n!,6]},IntegerDigits[n!,6] [[-(c+1)]]]; Array[nzd6,100,0] (* Harvey P. Dale, Sep 02 2015 *)

A136700 Final nonzero digit of n! in base 14.

Original entry on oeis.org

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

Views

Author

Carl R. White, Jan 16 2008

Keywords

Examples

			6! = 720 decimal = 396 quatridecimal, so a(6) = 6.
		

Crossrefs

A061010 Number of digits in (10^n)!.

Original entry on oeis.org

1, 7, 158, 2568, 35660, 456574, 5565709, 65657060, 756570557, 8565705523, 95657055187, 1056570551816, 11565705518104, 125657055180975, 1356570551809683, 14565705518096757, 155657055180967491
Offset: 0

Views

Author

Robert G. Wilson v, May 20 2001

Keywords

References

  • Jerry Glynn and Theodore Gray, "The Beginner's Guide To Mathematica, Version 4," Cambridge University Press, Cambridge, UK, 2000, p. 26.

Crossrefs

Programs

  • Mathematica
    Table[ Floor[ N[ Log[ 10, (10^n)! ]] + 1 ], {n, 0, 7} ]
    $MaxPrecision = Infinity; A061010[n_] := 1 + KroneckerDelta[n, 0] + Floor[(-2*10^n + Log[2] + (1 + 2*10^n)*n*Log[10] + Log[Pi])/(2*Log[10])] (* Enrique Pérez Herrero, Nov 09 2009 *)

Formula

From Enrique Pérez Herrero, Nov 09 2009: (Start)
a(n) = 1 + floor(log((10^n)!)/(log(10))), and using Stirling's approximation:
a(n) = 1 + delta(n,0) + floor((-2*10^n + log(2) + (1+2*10^n)*n*log(10) + log(Pi))/(2*log(10))). (End)
a(n) = 10^n*(n - 1/log(10)) + n/2 + O(1). [Arkadiusz Wesolowski, Jan 21 2012]

Extensions

a(7) from Farideh Firoozbakht, Jul 05 2005
More terms from Eric W. Weisstein, Dec 01 2005
Typo in formula fixed, and Mathematica formula changed to cover a(0)=1, Enrique Pérez Herrero, Feb 06 2010

A045547 Numbers whose factorial has '2' as its final nonzero digit.

Original entry on oeis.org

2, 5, 6, 8, 14, 19, 34, 35, 36, 38, 40, 41, 43, 47, 50, 51, 53, 62, 67, 74, 84, 85, 86, 88, 90, 91, 93, 97, 109, 110, 111, 113, 115, 116, 118, 122, 129, 132, 145, 146, 148, 150, 151, 153, 162, 167, 174, 177, 180, 181, 183, 189, 194, 200, 201, 203, 212, 217
Offset: 1

Views

Author

Keywords

Comments

From Robert Israel, Dec 16 2016: (Start)
If k is in the sequence, then:
if k == 0 (mod 5), k+1 is in the sequence;
if k == 1 (mod 5), k+1 is in A045548;
if k == 2 (mod 5), k+1 is in A045549;
if k == 3 (mod 5), k+1 is in A045550. (End)

Crossrefs

Programs

  • Maple
    count:= 0:
    r:= 1:
    for n from 2 while count < 100 do
      r:= r*n;
      if r mod 10 = 0 then r:= r/10^padic:-ordp(r, 5) fi;
      if r mod 10 = 2 then count:= count+1; A[count]:= n fi;
    od: seq(A[i], i=1..100); # Robert Israel, Dec 16 2016
  • Mathematica
    f[ n_Integer, m_Integer ] := (c = 0; p = 1; While[ d = Floor[ n/5^p ]; d > 0, c = c + d; p++ ]; Mod[ n!/10^c, m ] ); Select[ Range[ 250 ], f[ #, 10 ] == 2 & ]
    Join[{2},Select[Range[5,220],Most[Split[IntegerDigits[#!]]][[-1,1]] == 2&]] (* Harvey P. Dale, May 04 2016 *)
    f[n_] := Mod[6 Times @@ (Rest[ FoldList[{1 + #1[[1]], #2! 2^(#1[[1]] #2)} &, {0, 0}, Reverse[ IntegerDigits[n, 5]]]]), 10][[2]] (* after Jacob A. Siehler & Greg Dresden in A008904 *); f[0] = f[1] = 1; Select[ Range[150], f[#] == 2 &] (* Robert G. Wilson v, Dec 28 2016 *)
  • PARI
    lnz(n)=if(n<2, return(1)); my(m=Mod(1,5)); for(k=2,n, m*=k/10^valuation(k,5)); lift(chinese(Mod(0,2),m))
    is(n)=lnz(n)==2 \\ Charles R Greathouse IV, Dec 16 2016
    
  • PARI
    list(lim)=my(v=List(),m=Mod(1,5)); for(k=2,lim, m*=k/10^valuation(k,5); if(m==2, listput(v, k))); Vec(v) \\ Charles R Greathouse IV, Dec 16 2016
    
  • Python
    from functools import reduce
    from itertools import count, islice
    from sympy.ntheory.factor_ import digits
    def A045547_gen(startvalue=1): # generator of terms
        return filter(lambda n:2==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(n,5)[-1:0:-1])))*6%10, count(max(startvalue,1)))
    A045547_list = list(islice(A045547_gen(),30)) # Chai Wah Wu, Dec 07 2023

A045548 Numbers whose factorial has '4' as its final nonzero digit.

Original entry on oeis.org

4, 7, 20, 21, 23, 25, 26, 28, 37, 42, 49, 52, 55, 56, 58, 64, 69, 75, 76, 78, 87, 92, 99, 100, 101, 103, 112, 117, 124, 134, 135, 136, 138, 140, 141, 143, 147, 152, 155, 156, 158, 164, 169, 179, 182, 195, 196, 198, 202, 205, 206, 208, 214, 219
Offset: 1

Views

Author

Keywords

Comments

From Robert Israel, Dec 16 2016: (Start)
If n is in the sequence, then:
if n == 0 (mod 5), n+1 is in the sequence;
if n == 1 (mod 5), n+1 is in A045550;
if n == 2 (mod 5), n+1 is in A045547;
if n == 3 (mod 5), n+1 is in A045549. (End)

Crossrefs

Programs

  • Maple
    count:= 0:
    r:= 1:
    for n from 2 while count < 100 do
      r:= r*n;
      if r mod 10 = 0 then r:= r/10^padic:-ordp(r, 5) fi;
      if r mod 10 = 4 then count:= count+1; A[count]:= n fi;
    od: seq(A[i], i=1..100); # Robert Israel, Dec 16 2016
  • Mathematica
    f[n_] := Mod[6 Times @@ (Rest[ FoldList[{1 + #1[[1]], #2! 2^(#1[[1]] #2)} &, {0, 0}, Reverse[ IntegerDigits[n, 5]]]]), 10][[2]] (* after Jacob A. Siehler & Greg Dresden in A008904 *); f[0] = f[1] = 1; Select[ Range[150], f[#] == 4 &] (* Robert G. Wilson v, Dec 28 2016 *)
  • Python
    from itertools import count, islice
    from functools import reduce
    from sympy.ntheory.factor_ import digits
    def A045548_gen(startvalue=1): # generator of terms >= startvalue
        return filter(lambda n:4==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(digits(n,5)[-1:0:-1])),6), count(max(startvalue,1)))
    A045548_list = list(islice(A045548_gen(),30)) # Chai Wah Wu, Dec 07 2023

A045549 Numbers whose factorial has '6' as its final nonzero digit.

Original entry on oeis.org

3, 12, 17, 24, 29, 32, 45, 46, 48, 59, 60, 61, 63, 65, 66, 68, 72, 79, 82, 95, 96, 98, 104, 107, 120, 121, 123, 127, 130, 131, 133, 139, 144, 159, 160, 161, 163, 165, 166, 168, 172, 175, 176, 178, 187, 192, 199, 209, 210, 211, 213, 215, 216, 218
Offset: 1

Views

Author

Keywords

Comments

From Robert Israel, Dec 16 2016: (Start)
If n is in the sequence, then:
if n == 0 (mod 5), n+1 is in the sequence;
if n == 1 (mod 5), n+1 is in A045547;
if n == 2 (mod 5), n+1 is in A045550;
if n == 3 (mod 5), n+1 is in A045548. (End)

Crossrefs

Programs

  • Maple
    count:= 0:
    r:= 1:
    for n from 2 while count < 100 do
      r:= r*n;
      if r mod 10 = 0 then r:= r/10^padic:-ordp(r,5) fi;
      if r mod 10 = 6 then count:= count+1; A[count]:= n fi;
    od:
    seq(A[i],i=1..100); # Robert Israel, Dec 16 2016
  • Mathematica
    Join[{3}, Select[Range[5,250], Most[Split[IntegerDigits[#!]]][[-1, 1]] == 6 &]] (* Vincenzo Librandi, Dec 16 2016 *)
    f[n_] := Mod[6 Times @@ (Rest[ FoldList[{1 + #1[[1]], #2! 2^(#1[[1]] #2)} &, {0, 0}, Reverse[ IntegerDigits[n, 5]]]]), 10][[2]] (* after Jacob A. Siehler & Greg Dresden in A008904 *); f[0] = f[1] = 1; Select[ Range[150], f[#] == 6 &] (* Robert G. Wilson v, Dec 28 2016 *)
    Select[Range[250],With[{f=#!},Drop[IntegerDigits[f],-IntegerExponent[f]][[-1]]]==6&] (* Harvey P. Dale, Sep 27 2024 *)
  • Python
    from itertools import count, islice
    from functools import reduce
    from sympy.ntheory.factor_ import digits
    def A045549_gen(startvalue=2): # generator of terms >= startvalue
        return filter(lambda n:6==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(digits(n,5)[-1:0:-1])),6), count(max(startvalue,2)))
    A045549_list = list(islice(A045549_gen(),30)) # Chai Wah Wu, Dec 07 2023

A045550 Numbers whose factorial has '8' as its final nonzero digit.

Original entry on oeis.org

9, 10, 11, 13, 15, 16, 18, 22, 27, 30, 31, 33, 39, 44, 54, 57, 70, 71, 73, 77, 80, 81, 83, 89, 94, 102, 105, 106, 108, 114, 119, 125, 126, 128, 137, 142, 149, 154, 157, 170, 171, 173, 184, 185, 186, 188, 190, 191, 193, 197, 204, 207, 220, 221, 223
Offset: 1

Views

Author

Keywords

Comments

From Robert Israel, Dec 16 2016: (Start)
If n is in the sequence, then:
if n == 0 (mod 5), n+1 is in the sequence;
if n == 1 (mod 5), n+1 is in A045549;
if n == 2 (mod 5), n+1 is in A045548;
if n == 3 (mod 5), n+1 is in A045547. (End)

Crossrefs

Programs

  • Maple
    count:= 0:
    r:= 1:
    for n from 2 while count < 100 do
      r:= r*n;
      if r mod 10 = 0 then r:= r/10^padic:-ordp(r, 5) fi;
      if r mod 10 = 8 then count:= count+1; A[count]:= n fi;
    od:
    seq(A[i], i=1..100); # Robert Israel, Dec 16 2016
  • Mathematica
    Select[Range[5,250],Last[Flatten[Most[Split[IntegerDigits[#!]]]]]==8&] (* Harvey P. Dale, Jun 11 2014 *)
    f[n_] := Mod[6 Times @@ (Rest[ FoldList[{1 + #1[[1]], #2! 2^(#1[[1]] #2)} &, {0, 0}, Reverse[ IntegerDigits[n, 5]]]]), 10][[2]] (* after Jacob A. Siehler & Greg Dresden in A008904 *); f[0] = f[1] = 1; Select[ Range[150], f[#] == 8 &] (* Robert G. Wilson v, Dec 28 2016 *)
  • Python
    from itertools import count, islice
    from functools import reduce
    from sympy.ntheory.factor_ import digits
    def A045550_gen(startvalue=1): # generator of terms >= startvalue
        return filter(lambda n:8==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(digits(n,5)[-1:0:-1])),6), count(max(startvalue,1)))
    A045550_list = list(islice(A045550_gen(),30)) # Chai Wah Wu, Dec 07 2023
Previous Showing 11-20 of 31 results. Next