This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A360240 #11 Jun 07 2025 23:55:48 %S A360240 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, %T A360240 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, %U A360240 2,5,3,1,5,3,2,5,3,3,5,4,1,5,4,2,5,4,3 %N A360240 Weakly decreasing triples of positive integers sorted lexicographically and concatenated. %F A360240 a(n) = A331195(n-1) + 1. %e A360240 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), ... %t A360240 nn=9;Join@@Select[Tuples[Range[nn],3],GreaterEqual@@#&] %o A360240 (Python) %o A360240 from math import isqrt, comb %o A360240 from sympy import integer_nthroot %o A360240 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 %Y A360240 The triples have sums A070770. %Y A360240 Positions of first appearances are A158842. %Y A360240 For pairs instead of triples we have A330709 + 1. %Y A360240 The zero-based version is A331195. %Y A360240 - The first part is A360010 = A056556 + 1. %Y A360240 - The second part is A194848 = A056557 + 1. %Y A360240 - The third part is A333516 = A056558 + 1. %Y A360240 Cf. A002024, A003056, A069905. %K A360240 nonn %O A360240 1,4 %A A360240 _Gus Wiseman_, Feb 11 2023