cp's OEIS Frontend

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.

A360240 Weakly decreasing triples of positive integers sorted lexicographically and concatenated.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Feb 11 2023

Keywords

Examples

			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), ...
		

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.

Programs

  • Mathematica
    nn=9;Join@@Select[Tuples[Range[nn],3],GreaterEqual@@#&]
  • 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(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

Formula

a(n) = A331195(n-1) + 1.