OFFSET
0,1
COMMENTS
When n+1 and n^2+1 are both prime, then k=1.
FORMULA
a(n) = minimal value of k > 0 such that n^3 + k^2 is semiprime.
EXAMPLE
a(0) = 2 because 0^3 + 1^2 = 1 is not semiprime, but 0^3 + 2^2 = 4 = 2^2 is.
a(1) = 3 because 1^3 + 1^2 and 1^3 + 2^2 are not semiprime, but 1^3 + 3^2 = 10 = 2 * 5 is semiprime.
a(59) = 40 because 59^3 + 40^2 = 206979 = 3 * 68993 and for no smaller k > 0 is 59^3 + k^2 a semiprime.
a(100) = 1 because 100^3 + 1^2 = 1000001 = 101 * 9901.
MATHEMATICA
k2sp[n_]:=Module[{n3=n^3, k=1}, While[PrimeOmega[n3+k^2]!=2, k++]; k]; Array[ k2sp, 100, 0] (* Harvey P. Dale, Oct 15 2013 *)
PROG
(PARI) A109198(n)={local(r); r=1; while(bigomega(n^3+r^2)<>2, r=r+1); r} \\ Michael B. Porter, May 14 2010
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Jonathan Vos Post, Jun 22 2005
STATUS
approved