OFFSET
0,4
COMMENTS
By the conjecture in A256071, a(n) always exists.
LINKS
Zhi-Wei Sun, Table of n, a(n) for n = 0..10000
EXAMPLE
a(21) = 19 since 21 is not a generalized pentagonal number, and 19 is the least odd prime p with 21 - p a generalized pentagonal number.
a(26) = 0 since 26 = (-4)*(3*(-4)-1)/2 is a generalized pentagonal number.
MATHEMATICA
Pen[n_]:=IntegerQ[Sqrt[24n+1]]
Do[If[Pen[n], Print[n, " ", 0]; Goto[aa]]; Do[If[Pen[n-Prime[k]], Print[n, " ", Prime[k]]; Goto[aa]], {k, 2, PrimePi[n]}]; Label[aa]; Continue, {n, 0, 100}]
CROSSREFS
KEYWORD
nonn
AUTHOR
Zhi-Wei Sun, Mar 15 2015
STATUS
approved