cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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.

This page as a plain text file.
%I A385584 #30 Jul 10 2025 14:30:54
%S A385584 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,
%T A385584 15,15,16,16,16,16,16,18,19,19,20,20,20,21,21,21,21,22,22,22,22,22,23,
%U A385584 23,23,23,23,23,25,26,26,27,27,27,28,29,29,29,30,30,30,30,30,31,31,31
%N 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.
%C A385584 This sequence is nondecreasing.
%H A385584 David A. Corneth, <a href="/A385584/b385584.txt">Table of n, a(n) for n = 0..10000</a>
%H A385584 Zhi-Wei Sun, <a href="http://arxiv.org/abs/0905.0635">On universal sums of polygonal numbers</a>, arXiv:0905.0635 [math.NT], 2009-2015.
%F A385584 a(n) = card({(t in A000217, p in A000292) : t <= p, t + p <= n}). - _Peter Luschny_, Jul 10 2025
%e A385584 [n] #  solutions
%e A385584 ----------------------------------------------------
%e A385584 [0] 1 [(0, 0)]
%e A385584 [1] 2 [(0, 0), (1, 0)]
%e A385584 [2] 3 [(0, 0), (1, 0), (1, 1)]
%e A385584 [3] 3 [(0, 0), (1, 0), (1, 1)]
%e A385584 [4] 4 [(0, 0), (1, 0), (1, 1), (4, 0)]
%e A385584 [5] 5 [(0, 0), (1, 0), (1, 1), (4, 0), (4, 1)]
%e A385584 [6] 5 [(0, 0), (1, 0), (1, 1), (4, 0), (4, 1)]
%e A385584 [7] 6 [(0, 0), (1, 0), (1, 1), (4, 0), (4, 1), (4, 3)]
%e A385584 [8] 6 [(0, 0), (1, 0), (1, 1), (4, 0), (4, 1), (4, 3)]
%e A385584 [9] 6 [(0, 0), (1, 0), (1, 1), (4, 0), (4, 1), (4, 3)]
%o A385584 (Python)
%o A385584 def a(n: int) -> int:
%o A385584     count = 0
%o A385584     for p in range(n + 1):
%o A385584         pv = p * (p + 1) * (p + 2) // 6
%o A385584         if pv > n: break
%o A385584         for t in range(n - p + 1):
%o A385584             tv = t * (t + 1) // 2
%o A385584             if pv + tv <= n and tv <= pv:
%o A385584                 count += 1
%o A385584     return count
%o A385584 print([a(n) for n in range(74)])  # _Peter Luschny_, Jul 10 2025
%Y A385584 Cf. A000217, A000292, A001399, A001477, A027568.
%K A385584 nonn
%O A385584 0,2
%A A385584 _Robert G. Wilson v_, Jul 03 2025
%E A385584 New name and two terms (n=4 and n=20) corrected by _Peter Luschny_, Jul 10 2025