%I #21 Feb 16 2025 08:33:58
%S 2,5,7,7,1,7,7,1,7,7,7,1,7,7,7,7,7,1,7,1,7,1,7,7,1,7,7,1,7,1,1,7,1,7,
%T 7,7,1,7,1,7,1,1,7,1,7,1,1,7,1,7,7,7,1,1,7,7,7,1,7,1,1,7,1,7,7,7,1,7,
%U 1,7,7,7,7,1,7,7,7,7,7,7,7,7,7,1,7,1,7
%N Final digit of primes of the form k^2 + 1.
%C This sequence is presumably infinite. See 1st comment of A002496.
%C For k > 2, i.e., primes > 5 the final digit is always 1 or 7. Proof: Let k = 2*m - 1 odd. Then k^2 + 1 is divisible by 2, hence prime only for m = 1. Let k = 2*m even. Then k^2 + 1 = 4*m^2 + 1. The final digit of multiples of four is 4, 8, 2, 6, 0, 4, 8, 2, 6, 0, ... and of squares 1, 4, 9, 6, 5, 6, 9, 4, 1, 0, ... (cf. A008959), hence the last digit of the product 4*m^2 is 4, 6, 6, 4, 0, ... or of the sum 4*m^2 + 1 is 5, 7, 7, 5, 1, ... (cf. A053755) and therefore for primes > 5 the final digit is 1 or 7.
%C Accordingly, for large k approximately one-third of the primes of the form k^2 + 1 end in 1, two-thirds end in 7.
%H Robert Israel, <a href="/A325437/b325437.txt">Table of n, a(n) for n = 1..10000</a>
%H Edmund Landau, <a href="http://gdz.sub.uni-goettingen.de/dms/resolveppn/?PPN=GDZPPN002123789">Gelöste und ungelöste Probleme aus der Theorie der Primzahlverteilung und der Riemannschen Zetafunktion</a>, Jahresbericht der Deutschen Mathematiker-Vereinigung (1912), Vol. 21, page 208-228, here p. 224.
%H Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/LandausProblems.html">Landau's Problems.</a>, Nr. 4.
%H Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/Near-SquarePrime.html">Near-Square Prime.</a>
%F a(n) = A002496(n) mod 10.
%p seq(k mod 10,k=select(isprime,[2,seq(4*i^2+1,i=1..10000)]));
%t Mod[#,10]&/@Select[Range[1000]^2+1,PrimeQ] (* _Harvey P. Dale_, Jul 05 2023 *)
%o (PARI) lista(nn) = {forprime(p=2, nn, if (issquare(p-1), print1(p % 10, ", ")););} \\ _Michel Marcus_, May 07 2019
%Y Cf. A001912, A002496, A005574.
%K nonn,base,changed
%O 1,1
%A _Martin Renner_, Apr 27 2019