Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #11 Dec 03 2024 11:40:12
%S 1,2,6,3,1,1,3,1,9,7,3,3,1,1,3,1,3,7,7,9,9,7,3,9,1,7,7,1,7,3,9,3,3,1,
%T 9,1,1,7,1,7,1,9,9,9,7,9,1,1,3,1,9,7,3,3,3,1,3,7,7,9,9,7,1,7,7,1,7,7,
%U 9,3,7,1,9,3,9,1,3,7,9,9,1,9,9,9,7,3,9,1,7,7,1,7,3,1,1,9,7,3,3,9,9
%N Final nonzero digit of n-th primorial.
%C For n > 2, a(n) is in {1, 3, 7, 9}.
%H <a href="/index/Fi#final">Index entries for sequences related to final digits of numbers</a>
%F a(n) = prime(n)#/10 mod 10 for n > 2. - _Charles R Greathouse IV_, Dec 03 2024
%t Do[p = Product[Prime[m], {m, 1, n}]; While[Mod[p, 10] == 0, p = p/10]; Print[Mod[p, 10]], {n, 0, 100}]
%o (PARI) a(n)=if(n<3, return([1,2,6][n+1])); my(m=Mod(3,10)); forprime(p=7,prime(n), m*=p); lift(m) \\ _Charles R Greathouse IV_, Dec 03 2024
%Y Cf. A002110, A008904.
%K easy,nonn,base,changed
%O 0,2
%A _Robert G. Wilson v_, Jul 28 2000