A331195 Three-column table read by rows: triples (i,j,k) in order sorted from the left.
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
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.
Links
- Mehmet A. Ates, Table of n, a(n) for n = 0..10000
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