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.

A350604 Irregular triangle read by rows: row n lists the elements of the set S_n in increasing order, where S_1 = {1}, and S_{n+1} is the union of S_n, 2*S_n, and 3*S_n.

Original entry on oeis.org

1, 1, 2, 3, 1, 2, 3, 4, 6, 9, 1, 2, 3, 4, 6, 8, 9, 12, 18, 27, 1, 2, 3, 4, 6, 8, 9, 12, 16, 18, 24, 27, 36, 54, 81, 1, 2, 3, 4, 6, 8, 9, 12, 16, 18, 24, 27, 32, 36, 48, 54, 72, 81, 108, 162, 243, 1, 2, 3, 4, 6, 8, 9, 12, 16, 18, 24, 27, 32, 36, 48, 54, 64, 72, 81, 96, 108, 144, 162, 216, 243, 324, 486, 729
Offset: 1

Views

Author

N. J. A. Sloane, Jan 12 2022

Keywords

Comments

S_n contains n*(n+1)/2 elements.
The rows converge to A003586.

Examples

			The first few sets S_n are:
  [1],
  [1, 2, 3],
  [1, 2, 3, 4, 6, 9],
  [1, 2, 3, 4, 6, 8, 9, 12, 18, 27],
  [1, 2, 3, 4, 6, 8, 9, 12, 16, 18, 24, 27, 36, 54, 81],
  [1, 2, 3, 4, 6, 8, 9, 12, 16, 18, 24, 27, 32, 36, 48, 54, 72, 81, 108, 162, 243],
  ...
		

Crossrefs

Programs

  • Maple
    T:= proc(n) option remember; `if`(n=1, 1, sort(
         [map(k-> [k, 2*k, 3*k][], {T(n-1)})[]])[])
        end:
    seq(T(n), n=1..7);  # Alois P. Heinz, Jan 12 2022
  • Mathematica
    S[1] = {1};
    S[n_] := S[n] = Union[S[n-1], 2*S[n-1], 3*S[n-1]];
    Table[S[n], {n, 1, 7}] // Flatten (* Jean-François Alcover, Jun 02 2022 *)
  • Python
    from itertools import chain, islice
    def A350604_gen(): # generator of terms
        s = {1}
        while True:
            yield from sorted(s)
            s = set(chain.from_iterable((x,2*x,3*x) for x in s))
    A350604_list = list(islice(A350604_gen(),30)) # Chai Wah Wu, Jan 12 2022