OFFSET
0,13
LINKS
Mehmet A. Ates, Table of n, a(n) for n = 0..10000
EXAMPLE
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.
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]
PROG
(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))+2, 3)<<1))-((r<<2)<=(k<<2)*(k+1)+1) if a==1 else (r:=(b:=n//3)-comb((m:=integer_nthroot((n<<1)-3, 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
CROSSREFS
KEYWORD
nonn,easy,tabf
AUTHOR
Mehmet A. Ates, Jun 08 2020
STATUS
approved