login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A331195
Three-column table read by rows: triples (i,j,k) in order sorted from the left.
8
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,13
LINKS
FORMULA
a(3*n) = A056556(n).
a(3*n+1) = A056557(n).
a(3*n+2) = A056558(n).
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
See A372667 for the norms of these triples.
Sequence in context: A353501 A353428 A244738 * A215462 A025843 A303906
KEYWORD
nonn,easy,tabf
AUTHOR
Mehmet A. Ates, Jun 08 2020
STATUS
approved