OFFSET
1,1
COMMENTS
All the terms in the sequence, except a(1), are odd.
Since n^3 + n^2 + n + 1 = (n^2 + 1)(n + 1), it is a necessary condition for n^2 + 1 to be a prime, and n + 1 as well. - Alonso del Arte, Apr 22 2014
LINKS
K. D. Bajpai, Table of n, a(n) for n = 1..2539
FORMULA
Union of {4} and the members of A176070. - R. J. Mathar, Oct 04 2018
EXAMPLE
85 is in the sequence since 4^3 + 4^2 + 4 + 1 = 85 = 5 * 17, which is a semiprime.
259 is in the sequence since 6^3 + 6^2 + 6 + 1 = 259 = 7 * 37 which is a semiprime.
585 is not in the sequence, because, although it is 8^3 + 8^2 + 8 + 1, it has more than two prime factors.
MAPLE
select(x-> numtheory[bigomega](x)=2, [n^3+n^2+n+1$n=1..1500])[];
MATHEMATICA
A237627 = {}; Do[t = n^3 + n^2 + n + 1; If[PrimeOmega[t] == 2, AppendTo[A237627, t]], {n, 1500}]; A237627 (* K. D. Bajpai *)
(* For the b-file: *) n = 0; Do[t = k^3 + k^2 + k + 1; If[PrimeOmega[t] == 2, n++; Print[n, " ", t]], {k, 300000}] (* K. D. Bajpai *)
Select[Table[n^3 + n^2 + n + 1, {n, 500}], PrimeOmega[#] == 2 &] (* Alonso del Arte, Apr 22 2014 *)
PROG
(Magma) IsSemiprime:=func<i | &+[d[2]: d in Factorization(i)] eq 2>; [s: n in [1..1000] | IsSemiprime(s) where s is n^3+n^2+n+1]; // Bruno Berselli, Apr 23 2014
(Sage) A237627 = list(n^3 + n^2 + n + 1 for n in (1..1000) if is_prime(n^2+1) and is_prime(n+1)); print(A237627) # Bruno Berselli, Apr 23 2014 - see comment by Alonso del Arte
(PARI) is(n)=isprime(n^2+1) && isprime(n+1) \\ Charles R Greathouse IV, Aug 25 2014
(Python)
from itertools import islice
from sympy import isprime, nextprime
def A237627_gen(): # generator of terms
p = 1
while (p:=nextprime(p)):
if isprime((p-1)**2+1):
yield p*((p-1)**2+1)
CROSSREFS
KEYWORD
nonn
AUTHOR
K. D. Bajpai, Apr 22 2014
STATUS
approved