OFFSET
1,1
COMMENTS
Iwaniec proves that there are an infinite number of semiprimes or primes of the form n^2+1. Because n^2+1 is not a square for n>0, all such semiprimes have two distinct prime factors.
Moreover, this implies that one prime factor p of n^2+1 is strictly smaller than n, and therefore also divisor of (the usually much smaller) m^2+1, where m = n % p (binary "mod" operation). - M. F. Hasler, Mar 11 2012
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 1..10000
Henryk Iwaniec, Almost-primes represented by quadratic polynomials, Inventiones Mathematicae 47 (2) (1978), pp. 171-188.
FORMULA
a(n) = A085722(n)^2 + 1.
Equals { n^2+1 | A193432(n)=2 }. - M. F. Hasler, Mar 11 2012
MATHEMATICA
Select[Table[n^2 + 1, {n, 100}], PrimeOmega[#] == 2&] (* Vincenzo Librandi, Sep 22 2012 *)
PROG
(PARI) select(n->bigomega(n)==2, vector(500, n, n^2+1)) \\ Zak Seidov Feb 24 2011
(Magma) IsSemiprime:= func<n | &+[d[2]: d in Factorization(n)] eq 2>; [s: n in [1..100] | IsSemiprime(s) where s is n^2 + 1]; // Vincenzo Librandi, Sep 22 2012
(Python)
from sympy import primeomega
from itertools import count, takewhile
def aupto(limit):
form = takewhile(lambda x: x <= limit, (k**2+1 for k in count(1)))
return [number for number in form if primeomega(number)==2]
print(aupto(10202)) # Michael S. Branicky, Oct 26 2021
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
T. D. Noe, Sep 16 2008
STATUS
approved