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.

A333516 Irregular triangle read by rows in which row n lists the first A000217(n) terms of A002260, n >= 1.

Original entry on oeis.org

1, 1, 1, 2, 1, 1, 2, 1, 2, 3, 1, 1, 2, 1, 2, 3, 1, 2, 3, 4, 1, 1, 2, 1, 2, 3, 1, 2, 3, 4, 1, 2, 3, 4, 5, 1, 1, 2, 1, 2, 3, 1, 2, 3, 4, 1, 2, 3, 4, 5, 1, 2, 3, 4, 5, 6, 1, 1, 2, 1, 2, 3, 1, 2, 3, 4, 1, 2, 3, 4, 5, 1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 6, 7, 1, 1, 2, 1, 2, 3, 1, 2, 3, 4, 1, 2, 3, 4, 5, 1, 2, 3, 4, 5, 6
Offset: 1

Views

Author

Andrew Slattery, Mar 25 2020

Keywords

Comments

a(n) equals the difference between n and the largest number less than n that can be expressed as the sum of the i-th triangular number and the j-th tetrahedral number for integers i < j.

Examples

			Triangle begins:
  1;
  1, 1, 2;
  1, 1, 2, 1, 2, 3;
  1, 1, 2, 1, 2, 3, 1, 2, 3, 4;
  1, 1, 2, 1, 2, 3, 1, 2, 3, 4, 1, 2, 3, 4, 5;
  1, 1, 2, 1, 2, 3, 1, 2, 3, 4, 1, 2, 3, 4, 5, 1, 2, 3, 4, 5, 6;
  1, 1, 2, 1, 2, 3, 1, 2, 3, 4, 1, 2, 3, 4, 5, 1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 6, 7;
  ...
		

Crossrefs

Row sums give A000292.
Right border gives A000027.

Programs

  • Maple
    T:= n-> seq([$1..i][], i=1..n):
    seq(T(n), n=1..7);  # Alois P. Heinz, Apr 10 2020
  • Python
    from math import comb, isqrt
    from sympy import integer_nthroot
    def A333516(n): return (r:=n-1-comb((m:=integer_nthroot(6*n,3)[0])+(n>comb(m+2,3))+1,3))-comb((k:=isqrt(m:=r+1<<1))+(m>k*(k+1)),2)+1 # Chai Wah Wu, Nov 10 2024

Formula

a(n) = A002260(A124171(n)).