login
Final nonzero digit of n! in base 15.
15

%I #10 Jul 11 2023 14:56:02

%S 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,

%T 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,

%U 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

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

%C From _Robert Israel_, Jun 08 2018: (Start)

%C For n >= 6, a(n) is 3, 6, 9 or 12.

%C For k >= 2, a(5*k) = a(5*k+1) = a(5*k+3). (End)

%H Robert Israel, <a href="/A136701/b136701.txt">Table of n, a(n) for n = 0..10000</a>

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

%p a:= 1: b:= 0: R[0]:= 1:

%p for n from 1 to 100 do

%p alpha:= padic:-ordp(n,3);

%p beta:= padic:-ordp(n,5);

%p a:= a * n/3^alpha/5^beta;

%p b:= b + alpha - beta;

%p R[n]:= a * 3 &^ b mod 15;

%p od:

%p seq(R[n],n=0..100); # _Robert Israel_, Jun 08 2018

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

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

%K base,easy,nonn

%O 0,3

%A _Carl R. White_, Jan 16 2008