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.
%I A136692 #14 Jun 27 2025 17:59:30 %S A136692 1,1,2,1,4,4,4,3,4,1,2,2,4,2,3,4,4,3,4,1,4,4,3,4,1,1,1,2,1,4,4,4,3,4, %T A136692 1,2,2,4,2,3,4,4,3,4,1,4,4,3,4,1,2,2,4,2,3,3,3,1,3,2,4,4,3,4,1,3,3,1, %U A136692 3,2,3,3,1,3,2,1,1,2,1,4,4,4,3,4,1,2,2,4,2,3,4,4,3,4,1,4,4,3,4,1 %N A136692 Final nonzero digit of n! in base 5. %H A136692 Robert Israel, <a href="/A136692/b136692.txt">Table of n, a(n) for n = 0..10000</a> %F A136692 a(n) = (n!/A243757(n)) mod 5. - _Ridouane Oudra_, Sep 27 2024 %e A136692 6! = 720 decimal = 10340 quinary, so a(6) = 4. %p A136692 f:= proc(n) option remember; %p A136692 local t; %p A136692 t:= n / 5^padic:-ordp(n,5); %p A136692 procname(n-1)*t mod 5 %p A136692 end proc: %p A136692 f(0):= 1: %p A136692 map(f, [$0..100]); # _Robert Israel_, Jun 27 2025 %t A136692 Table[Module[{sp=Split[IntegerDigits[n!,5]]},If[sp[[-1,-1]]==0,sp[[-2, -1]], sp[[-1,-1]]]],{n,0,100}] (* _Harvey P. Dale_, Oct 26 2016 *) %o A136692 (PARI) a(n)={my(v=[1, 1, 2, 1, 4, 4, 4, 3, 4, 1]); if(n==0, 1, lift(prod(k=0, logint(n,5), Mod(v[1 + n\5^k % 10], 5))))} \\ _Andrew Howroyd_, Sep 27 2024 %Y A136692 Cf. A000142, A136690, A136691, A136693, A136694, A136695, A136696, A008904, A136697, A136698, A136699, A136700, A136701, A136702. %Y A136692 Cf. A243757. %K A136692 base,easy,nonn %O A136692 0,3 %A A136692 _Carl R. White_, Jan 16 2008