[go: up one dir, main page]

login
A056557
Second tetrahedral coordinate.
18
0, 0, 1, 1, 0, 1, 1, 2, 2, 2, 0, 1, 1, 2, 2, 2, 3, 3, 3, 3, 0, 1, 1, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 0, 1, 1, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 0, 1, 1, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 0, 1, 1, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5
OFFSET
0,8
COMMENTS
If {(X,Y,Z)} are triples of nonnegative integers with X >= Y >= Z ordered by X, Y and Z, then X=A056556(n), Y=A056557(n) and Z=A056558(n).
FORMULA
a(n) = floor((sqrt(8*(n-A056556(n)*(A056556(n)+1)*(A056556(n)+2)/6)+1)-1)/2) = A003056(n-A000292(A056556(n)-1)).
a(n+1) = 0 if A056556(n) = A056558(n); a(n+1) = a(n)+1 if a(n) = A056558(n); otherwise a(n+1) = a(n). - Graeme McRae, Jan 09 2007
PROG
(Python)
from math import isqrt, comb
from sympy import integer_nthroot
def A056557(n): return (k:=isqrt(r:=n+1-comb((m:=integer_nthroot(6*(n+1), 3)[0])-(n<comb(m+2, 3))+2, 3)<<1))-((r<<2)<=(k<<2)*(k+1)+1) # Chai Wah Wu, Nov 04 2024
CROSSREFS
KEYWORD
nonn,changed
AUTHOR
Henry Bottomley, Jun 26 2000
STATUS
approved