# Greetings from The On-Line Encyclopedia of Integer Sequences! http://oeis.org/ Search: id:a145172 Showing 1-1 of 1 %I A145172 #9 Apr 22 2021 04:07:21 %S A145172 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, %T A145172 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, %U A145172 4,1,2,3,4,5,2,3,4,5,6,3,4,2,3,4,5,6,3,4,5,6 %N A145172 Number of pentagonal numbers needed to represent n with greedy algorithm. %C A145172 Sequence is unbounded. %H A145172 Andrew Howroyd, Table of n, a(n) for n = 1..10000 %e A145172 a(21)=6 since 21 = 12+5+1+1+1+1. %o A145172 (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 %Y A145172 Cf. A000326 (pentagonal numbers), A053610, A057945, A180447, A192988. %K A145172 nonn %O A145172 1,2 %A A145172 Christina Steffan (christina.steffan(AT)gmx.at), Oct 03 2008 %E A145172 Terms a(41) and beyond from _Andrew Howroyd_, Apr 21 2021 # Content is available under The OEIS End-User License Agreement: http://oeis.org/LICENSE