A376993 a(n) = A376992(n) - 10^(n-1).
4, 3, 13, 13, 513, 801, 6781, 30721, 40513, 1057513, 515313, 16728501, 78402181, 13617661, 472012281, 64846161, 5481873013, 2459693601, 116852093013, 62611784481, 1234170737761, 1565435686113, 17492477581161, 2254878102513, 16836143444113, 229959946206301
Offset: 1
Programs
-
Mathematica
a[n_]:=(Module[{k=1}, While[!PrimeQ[m=2k^2+2k+1]||IntegerLength[m]
-
Python
from math import isqrt from itertools import count from sympy import isprime def A376993(n): for k in count(isqrt(((a:=10**(n-1))<<1)-1>>2)): m = 2*k*(k+1)+1 if m >= a and isprime(m): return m-a # Chai Wah Wu, Oct 13 2024
Extensions
a(21)-a(26) from Chai Wah Wu, Oct 13 2024