A355717 Smallest number of generalized pentagonal numbers which sum to n.
0, 1, 1, 2, 2, 1, 2, 1, 2, 2, 2, 3, 1, 2, 2, 1, 2, 2, 3, 2, 2, 3, 1, 2, 2, 3, 1, 2, 2, 2, 2, 2, 3, 2, 2, 1, 2, 2, 2, 3, 1, 2, 2, 3, 2, 2, 3, 2, 2, 3, 2, 1, 2, 2, 3, 2, 2, 1, 2, 2, 3, 2, 2, 2, 2, 3, 2, 3, 3, 2, 1, 2, 2, 2, 3, 2, 3, 1, 2, 2, 2, 3, 2, 2, 2, 2, 2, 3, 3, 2, 3, 2, 1, 2, 2, 3, 2, 2, 3, 2, 1
Offset: 0
Keywords
Examples
Let GPN = {0, 1, 2, 5, ...} be the generalized pentagonal numbers. a(0) = 0 since {} is a multiset of GPN, Sum {} = 0, and card({}) = 0. a(1) = 1 since {1} is a multiset of GPN, Sum {1} = 1, and card({1}) = 1. a(3) = 2 since {1, 2} is a multiset of GPN, Sum {1, 2} = 3, and card({1, 2}) = 2. a(11) = 3 since {2, 2, 7} is a multiset of GPN, Sum {2, 2, 7} = 11, card({2, 2, 7}) = 3, and no other multiset S of GPN with Sum(S) = 11 has less members.
References
- Richard K. Guy, Unsolved Problems in Number Theory, 3rd Edition, Springer, 2004, Section D3, Figurate numbers, pp. 222-228.
Links
- Eric Weisstein's World of Mathematics, Pentagonal Number Theorem.
Programs
-
Maple
A355717_list := proc(upto) local P, Q, k, q, isgpn; P := []; Q := [0]; isgpn := k -> ormap(n -> 0 = 8*k - (n + irem(n,2)) * (3*n + 2 - irem(n,2)), [$0..k]); for k from 1 to upto do q := 3; if isgpn(k) then P := [op(P), k]; q := 1; elif ormap(p -> member(k - p, P), P) then q := 2 fi: Q := [op(Q), q]; od: Q end: print(A355717_list(100)); # Peter Luschny, Jul 18 2022
-
Python
def A355717_list(ln: int) -> list[int]: P: list[int] = [] Q: list[int] = [0] def is_gpn(k: int) -> bool: return any(8 * k == ((n + n % 2) * (3 * n + 2 - n % 2)) for n in range(k + 1)) for k in range(1, ln): q = 3 if is_gpn(k): P.append(k) q = 1 elif any([(k - p) in P for p in P]): q = 2 Q.append(q) return Q print(A355717_list(100)) # Peter Luschny, Jul 18 2022
Formula
a(n) <= 3.
a(A001318(n)) = 1.
Comments