login
A360240
Weakly decreasing triples of positive integers sorted lexicographically and concatenated.
2
1, 1, 1, 2, 1, 1, 2, 2, 1, 2, 2, 2, 3, 1, 1, 3, 2, 1, 3, 2, 2, 3, 3, 1, 3, 3, 2, 3, 3, 3, 4, 1, 1, 4, 2, 1, 4, 2, 2, 4, 3, 1, 4, 3, 2, 4, 3, 3, 4, 4, 1, 4, 4, 2, 4, 4, 3, 4, 4, 4, 5, 1, 1, 5, 2, 1, 5, 2, 2, 5, 3, 1, 5, 3, 2, 5, 3, 3, 5, 4, 1, 5, 4, 2, 5, 4, 3
OFFSET
1,4
FORMULA
a(n) = A331195(n-1) + 1.
EXAMPLE
Triples begin: (1,1,1), (2,1,1), (2,2,1), (2,2,2), (3,1,1), (3,2,1), (3,2,2), (3,3,1), (3,3,2), (3,3,3), ...
MATHEMATICA
nn=9; Join@@Select[Tuples[Range[nn], 3], GreaterEqual@@#&]
PROG
(Python)
from math import isqrt, comb
from sympy import integer_nthroot
def A360240(n): return (m:=integer_nthroot((n-1<<1)+6, 3)[0])+(n>3*comb(m+2, 3)) if (a:=n%3)==1 else (k:=isqrt(r:=(b:=(n-1)//3)+1-comb((m:=integer_nthroot((n-1<<1)-1, 3)[0])-(b<comb(m+2, 3))+2, 3)<<1))+((r<<2)>(k<<2)*(k+1)+1) if a==2 else 1+(r:=(b:=(n-1)//3)-comb((m:=integer_nthroot((n-1<<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, Jun 07 2025
CROSSREFS
The triples have sums A070770.
Positions of first appearances are A158842.
For pairs instead of triples we have A330709 + 1.
The zero-based version is A331195.
- The first part is A360010 = A056556 + 1.
- The second part is A194848 = A056557 + 1.
- The third part is A333516 = A056558 + 1.
Sequence in context: A008679 A029435 A089643 * A185090 A115268 A103610
KEYWORD
nonn
AUTHOR
Gus Wiseman, Feb 11 2023
STATUS
approved