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
Robert Israel, Table of n, a(n) for n = 1..10000
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
