login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A045547 Numbers n such that final nonzero digit of n! is '2'. 5
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 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,1

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 A045548;

if n == 2 (mod 5), n+1 is in A045549;

if n == 3 (mod 5), n+1 is in A045550. (End)

LINKS

Robert Israel, Table of n, a(n) for n = 1..10000

Index entries for sequences related to final digits of numbers

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 *)

PROG

(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

CROSSREFS

Cf. A008904, A045548, A045549, A045550.

Sequence in context: A028796 A242422 A019989 * A127143 A242665 A079256

Adjacent sequences:  A045544 A045545 A045546 * A045548 A045549 A045550

KEYWORD

nonn,base,changed

AUTHOR

Jeff Burch

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent | More pages
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy .

Last modified October 18 10:28 EDT 2017. Contains 293507 sequences.