OFFSET
1,1
COMMENTS
It is conjectured that every integer and hence every pentagonal number, greater than 33066, hence greater than A000326(149) = 33227, can be represented as the sum of three pentagonal numbers. - Jonathan Vos Post, Dec 18 2007
FORMULA
EXAMPLE
a(1)=70=P(7) is the least pentagonal number which can be written as sum of two other pentagonal numbers, P(7)=P(5)+P(5).
PROG
(PARI) P(n)=n*(3*n-1)>>1 /* a.k.a. A000326 */
isPent(t)=P(sqrtint(t<<1\3)+1)==t
for(i=1, 299, for(j=1, (i+1)\sqrt(2), isPent(P(i)-P(j)) && print1(P(i)", ") || next(2)))
/* The following is much faster, at the cost of implementing sum2sqr(), cf. A133388*/
A136117next(i)=i=sqrtint(i\3*2)*6+5; until(0, for(j=2, #t=sum2sqr((i+=6)^2+1), t[j]%6==[5, 5] && break(2))); i^2\24
A136117vect(n, i)=vector(n, j, i=A136117next(i)) /* 2nd arg =0 by default but allows one to start elsewhere */
A136117(n, i)=until(!n--, i=A136117next(i)); i \\ M. F. Hasler, Dec 25 2007
CROSSREFS
KEYWORD
nonn
AUTHOR
M. F. Hasler, Dec 15 2007; corrected Dec 25 2007
STATUS
approved