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.

Original entry on oeis.org

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

Views

Author

Robert G. Wilson v, Jul 03 2025

Keywords

Comments

This sequence is nondecreasing.

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)]
		

Crossrefs

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

a(n) = card({(t in A000217, p in A000292) : t <= p, t + p <= n}). - Peter Luschny, Jul 10 2025

Extensions

New name and two terms (n=4 and n=20) corrected by Peter Luschny, Jul 10 2025