OFFSET
1,1
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..104 (* All terms up to and including the 2 millionth prime. *)
EXAMPLE
2 is in the sequence because there is no semiprime between the two primes 1^2 + 1 = 2 and 2^2 + 1 = 5 of the form k^2 + 1.
2917 is in the sequence because there is no semiprime between the two primes 54^2 + 1 = 2917 and 56^2 + 1 = 3127 : 55^2 + 1 = 3026 = 2*17*89 is not a semiprime.
MAPLE
with(numtheory):nn:=2000: lst:={}:
for n from 1 to nn do:
if type(n^2+1, prime)=true
then
lst:=lst union {n}:
else
fi:
od:
n1:=nops(lst):
for m from 1 to n1-1 do:
i1:=lst[m]:i2:=lst[m+1]:ii:=0:
for k from i1+1 to i2-1 do:
x:=k^2+1:y:=factorset(x):
if bigomega(x)=2 and nops(y)=2
then
ii:=ii+1:
else
fi:
od:
if ii=0
then
printf(`%d, `, i1^2+1):
else
fi:
od:
MATHEMATICA
nspQ[{a_, b_}]:=Select[Range[a+1, b-1], IntegerQ[Sqrt[#-1]]&&PrimeOmega[#]==2&]=={}; With[{cp=Partition[Select[Prime[Range[200000]], IntegerQ[Sqrt[#-1 ]]&], 2, 1]}, Select[cp, nspQ]][[;; , 1]] (* Harvey P. Dale, Oct 23 2025 *)
PROG
(PARI)
for(n=1, 10^4, if(isprime(n^2+1), k=1; while(!isprime((n+k)^2+1), k++); c=0; for(i=1, k-1, d=factor((n+i)^2+1); s=sum(j=1, #d[, 1], d[j, 2]); if(s==2, c++; break)); if(c==0, print1(n^2+1, ", ")))) \\ Derek Orr, Aug 15 2014
CROSSREFS
KEYWORD
nonn
AUTHOR
Michel Lagneau, Aug 15 2014
STATUS
approved
