close
login
A387940
a(n) is the smallest squarefree semiprime k such that n^2 + k is a perfect square.
1
15, 21, 55, 33, 39, 85, 15, 57, 115, 21, 203, 145, 87, 93, 259, 33, 35, 205, 39, 129, 235, 141, 371, 265, 51, 413, 55, 57, 183, 469, 335, 65, 355, 69, 219, 553, 395, 77, 415, 249, 623, 85, 87, 1313, 91, 93, 95, 505, 303, 309, 535, 321, 327, 565, 111, 2489, 115
OFFSET
1,1
COMMENTS
Every odd squarefree semiprime belongs to this list, since if k is in A046388, then a((k - 1)/2) = k.
Conjecture: a(n) always exists. Given an integer n, if (2*n + 1) is squarefree semiprime, then a(n) = 2*n + 1, since n^2 + (2*n + 1) = (n + 1)^2. If (2*n + 1) is not a squarefree semiprime, let k = p*q, where p and q are primes with p < q. If n^2 + p*q = m^2, then p*q = (m - n)*(m + n), so p = m - n and q = m + n. From this it follows that q - p = 2*n. If Polignac's conjecture were true, then there exist infinitely many pairs of primes whose difference is 2*n. The solution to our problem corresponds to the smallest prime p such that 2*n + p is also prime. In that case, n^2 + p*q = (n + p)^2.
LINKS
EXAMPLE
For n = 3, we have 3^2 + 55 = 8^2, where 55 = 5*11. Moreover, none of 7^2 - 3^2, 6^2 - 3^2, 5^2 - 3^2 and 4^2 - 3^2 is a squarefree semiprime. Thus a(3) = 55.
MAPLE
f:= proc(n) local p;
if ifactors(2*n+1)[2][.., 2] = [1, 1] then return 2*n+1 fi;
p:= 3;
do
if isprime(p+2*n) then return p*(2*n+p) fi;
p:= nextprime(p)
od
end proc:
map(f, [$1..100]); # Robert Israel, Dec 08 2025
MATHEMATICA
a[n_] := Module[{k=1}, While[!SquareFreeQ[k] || PrimeOmega[k]!=2 || !IntegerQ[Sqrt[n^2+k]], k++]; k]; Array[a, 57] (* Stefano Spezia, Dec 08 2025 *)
PROG
(PARI) a(n) = my(k=1); while (!(issquare(n^2+k) && (bigomega(k)==2) && (omega(k)==2)), k++); k; \\ Michel Marcus, Dec 08 2025
CROSSREFS
KEYWORD
nonn
AUTHOR
Gonzalo Martínez, Dec 08 2025
STATUS
approved