login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A256119
Least number p that is zero or an odd prime, such that n - p is a generalized pentagonal number.
2
0, 0, 0, 3, 3, 0, 5, 0, 3, 7, 3, 11, 0, 11, 7, 0, 11, 5, 3, 7, 5, 19, 0, 11, 17, 3, 0, 5, 13, 3, 23, 5, 17, 7, 19, 0, 29, 11, 3, 13, 0, 19, 7, 3, 29, 5, 11, 7, 13, 23, 43, 0, 17, 13, 3, 29, 5, 0, 7, 19, 3, 59, 5, 23, 7, 43, 31, 41, 11, 29, 0, 31, 37, 3, 17, 5, 19, 0, 43, 53, 3, 11, 5, 13, 7, 59, 29, 17, 11, 19, 13, 79, 0, 23, 17, 3, 19, 5, 41, 7, 0
OFFSET
0,4
COMMENTS
By the conjecture in A256071, a(n) always exists.
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