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.

A331195 Three-column table read by rows: triples (i,j,k) in order sorted from the left.

Original entry on oeis.org

0, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 1, 2, 0, 0, 2, 1, 0, 2, 1, 1, 2, 2, 0, 2, 2, 1, 2, 2, 2, 3, 0, 0, 3, 1, 0, 3, 1, 1, 3, 2, 0, 3, 2, 1, 3, 2, 2, 3, 3, 0, 3, 3, 1, 3, 3, 2, 3, 3, 3, 4, 0, 0, 4, 1, 0, 4, 1, 1, 4, 2, 0, 4, 2, 1, 4, 2, 2, 4, 3, 0, 4, 3, 1, 4, 3, 2, 4, 3, 3, 4, 4, 0, 4, 4, 1, 4, 4, 2, 4, 4, 3, 4, 4, 4, 5, 0, 0
Offset: 0

Views

Author

Mehmet A. Ates, Jun 08 2020

Keywords

Examples

			For n=[0,1,2] to n=[12,13,14], a[n,n+1,n+2] counts up as such: [0,0,0], [1,0,0], [1,1,0], [1,1,1], [2,0,0], etc.
		

Crossrefs

See A372667 for the norms of these triples.

Programs

  • Mathematica
    ThreeDVectors = List[];
    SeqSize = 10;
    For[i = 0, i <= SeqSize, i++,
      For[j = 0, j <= i, j++,
        For[k = 0, k <= j, k++,
          AppendTo[ThreeDVectors, {i, j, k}]
        ]
      ]
    ];
    Flatten[ThreeDVectors]
  • Python
    from math import comb, isqrt
    from sympy import integer_nthroot
    def A331195(n): return (m:=integer_nthroot((n<<1)+6,3)[0])-(n<3*comb(m+2,3)) if not (a:=n%3) else (k:=isqrt(r:=(b:=n//3)+1-comb((m:=integer_nthroot((n<<1)-1,3)[0])-(b=comb(m+2,3))+1,3))-comb((k:=isqrt(m:=r+1<<1))+(m>k*(k+1)),2) # Chai Wah Wu, Nov 23 2024

Formula

a(3*n) = A056556(n).
a(3*n+1) = A056557(n).
a(3*n+2) = A056558(n).