A376992 a(n) is the least n-digit prime of the form j^2 + (j+1)^2.
5, 13, 113, 1013, 10513, 100801, 1006781, 10030721, 100040513, 1001057513, 10000515313, 100016728501, 1000078402181, 10000013617661, 100000472012281, 1000000064846161, 10000005481873013, 100000002459693601, 1000000116852093013, 10000000062611784481, 100000001234170737761
Offset: 1
Programs
-
Maple
f:= proc(n) local j,x; for j from ceil((sqrt(2*10^(n-1)-1)-1)/2) do x:= j^2 + (j+1)^2; if isprime(x) then return x fi od end proc: map(f, [$1..40]); # Robert Israel, Oct 13 2024
-
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 prime def A376992(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 # Chai Wah Wu, Oct 13 2024
Formula
Conjecture: a(n+1)/a(n) ~ 10.