|
|
A145172
|
|
Number of pentagonal numbers needed to represent n with greedy algorithm.
|
|
2
|
|
|
1, 2, 3, 4, 1, 2, 3, 4, 5, 2, 3, 1, 2, 3, 4, 5, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 2, 3, 4, 5, 6, 3, 4, 2, 1, 2, 3, 4, 5, 2, 3, 4, 5, 6, 3, 4, 2, 3, 4, 5, 1, 2, 3, 4, 5, 2, 3, 4, 5, 6, 3, 4, 2, 3, 4, 5, 6, 3, 4, 1, 2, 3, 4, 5, 2, 3, 4, 5, 6, 3, 4, 2, 3, 4, 5, 6, 3, 4, 5, 6
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
COMMENTS
|
Sequence is unbounded.
|
|
LINKS
|
|
|
EXAMPLE
|
a(21)=6 since 21 = 12+5+1+1+1+1.
|
|
PROG
|
(PARI) a(n)={my(s=0); forstep(k=(sqrtint(24*n+1)+1)\6, 1, -1, my(t=k*(3*k-1)/2); s+=n\t; n%=t); s} \\ Andrew Howroyd, Apr 21 2021
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
Christina Steffan (christina.steffan(AT)gmx.at), Oct 03 2008
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|