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

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A136690 Final nonzero digit of n! in base 3. 14

%I

%S 1,1,2,2,2,1,2,2,1,1,1,2,2,2,1,2,2,1,2,2,1,1,1,2,1,1,2,2,2,1,1,1,2,1,

%T 1,2,2,2,1,1,1,2,1,1,2,1,1,2,2,2,1,2,2,1,2,2,1,1,1,2,1,1,2,2,2,1,1,1,

%U 2,1,1,2,1,1,2,2,2,1,2,2,1,1,1,2,2,2,1,2,2,1,1,1,2,2,2,1,2,2,1,2,2,1,1,1,2

%N Final nonzero digit of n! in base 3.

%e 6! = 720 decimal = 222200 ternary, so a(6) = 2.

%t f[n_] := Mod[6 Times @@ (Rest[ FoldList[{1 + #1[[1]], #2! 2^(#1[[1]] #2)} &, {0, 0}, Reverse[ IntegerDigits[n, 3]]]]), 10][[2]]; # /. {0 -> 1} & /@ Mod[Table[f@n, {n, 0, 104}], 3] (* _Robert G. Wilson v_, Apr 17 2010 *)

%t fnzd[n_]:=Module[{sidn3=Split[IntegerDigits[n!,3]]},If[MemberQ[ Last[ sidn3],0], sidn3[[-2,1]], sidn3[[-1,1]]]]; Array[fnzd,110,0] (* _Harvey P. Dale_, May 03 2018 *)

%Y Cf. A000142, A136691, A136692, A136693, A136694, A136695, A136696, A008904, A136697, A136698, A136699, A136700, A136701, A136702.

%K base,easy,nonn

%O 0,3

%A _Carl R. White_, Jan 16 2008

%E More terms from _Robert G. Wilson v_, Apr 17 2010

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 23 07:08 EDT 2019. Contains 323508 sequences. (Running on oeis4.)