A385584 a(n) is the number of pairs (p, t) such that p is a pyramidal number, t is a triangular number, p + t <= n and t <= p.
1, 2, 3, 3, 4, 5, 5, 6, 6, 6, 7, 8, 8, 9, 9, 9, 10, 10, 10, 10, 12, 13, 13, 14, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 16, 18, 19, 19, 20, 20, 20, 21, 21, 21, 21, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 25, 26, 26, 27, 27, 27, 28, 29, 29, 29, 30, 30, 30, 30, 30, 31, 31, 31
Offset: 0
Keywords
Examples
[n] # solutions ---------------------------------------------------- [0] 1 [(0, 0)] [1] 2 [(0, 0), (1, 0)] [2] 3 [(0, 0), (1, 0), (1, 1)] [3] 3 [(0, 0), (1, 0), (1, 1)] [4] 4 [(0, 0), (1, 0), (1, 1), (4, 0)] [5] 5 [(0, 0), (1, 0), (1, 1), (4, 0), (4, 1)] [6] 5 [(0, 0), (1, 0), (1, 1), (4, 0), (4, 1)] [7] 6 [(0, 0), (1, 0), (1, 1), (4, 0), (4, 1), (4, 3)] [8] 6 [(0, 0), (1, 0), (1, 1), (4, 0), (4, 1), (4, 3)] [9] 6 [(0, 0), (1, 0), (1, 1), (4, 0), (4, 1), (4, 3)]
Links
- David A. Corneth, Table of n, a(n) for n = 0..10000
- Zhi-Wei Sun, On universal sums of polygonal numbers, arXiv:0905.0635 [math.NT], 2009-2015.
Programs
-
Python
def a(n: int) -> int: count = 0 for p in range(n + 1): pv = p * (p + 1) * (p + 2) // 6 if pv > n: break for t in range(n - p + 1): tv = t * (t + 1) // 2 if pv + tv <= n and tv <= pv: count += 1 return count print([a(n) for n in range(74)]) # Peter Luschny, Jul 10 2025
Formula
Extensions
New name and two terms (n=4 and n=20) corrected by Peter Luschny, Jul 10 2025
Comments