OFFSET
1,1
COMMENTS
EXAMPLE
a(8) = a(7)^2 + 52 and there is no smaller k such that a(7)^2 + k is semiprime.
MATHEMATICA
nxt[n_]:=Module[{sp=n^2+1}, While[PrimeOmega[sp]!=2, sp++]; sp]; NestList[nxt, 4, 7] (* Harvey P. Dale, Oct 22 2012 *)
PROG
(Python)
from itertools import accumulate
from sympy.ntheory.factor_ import primeomega
def nextsemiprime(n):
while primeomega(n + 1) != 2: n += 1
return n + 1
def f(anm1, _): return nextsemiprime(anm1**2)
print(list(accumulate([4]*6, f))) # Michael S. Branicky, Apr 21 2021
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Jonathan Vos Post, May 05 2006
STATUS
approved