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.

Showing 1-1 of 1 results.

A360298 Irregular triangle (an infinite binary tree) read by rows. The tree has root node 1 in row n = 1. For n > 1, each node with value m in row n-1 has a left child with value m / n if n divides m, and a right child with value m * n.

Original entry on oeis.org

1, 2, 6, 24, 120, 20, 720, 140, 5040, 1120, 630, 40320, 10080, 70, 5670, 4480, 362880, 1008, 100800, 7, 700, 567, 56700, 448, 44800, 36288, 3628800, 11088, 1108800, 77, 7700, 6237, 623700, 4928, 492800, 399168, 39916800, 924, 133056, 92400, 13305600, 924, 92400, 74844, 51975, 7484400, 59136, 5913600, 33264, 4790016, 3326400, 479001600
Offset: 1

Views

Author

Rémy Sigrist, Feb 02 2023

Keywords

Comments

This sequence is a variant of A360173; here we use divisions and multiplications, there subtractions and additions.
The n-th row has A360299(n) terms, starts with A008336(n+1) and ends with A000142(n).

Examples

			The tree begins:
  n     n-th row
  --    --------
   1    1___
            |
   2        2___
                |
   3            6___
                    |
   4               24___
                        |
   5      _____________120_____________
         |                             |
   6    20___                         720___
             |                              |
   7        140___                   _____5040_____
                  |                 |              |
   8            1120__           __630__       __40320__
                      |         |       |     |         |
   9                10080      70     5670  4480     362880
		

Crossrefs

Cf. A000142, A008336, A360173, A360299 (row lengths), A360300.

Programs

  • PARI
    row(n) = { my (r = [1]); for (h = 2, n, r=concat(apply(v -> if (v%h==0, [v/h, v*h], [v*h]), r))); return (r) }
    
  • Python
    from functools import cache
    @cache
    def row(n):
        if n == 1: return [1]
        out = []
        for r in row(n-1): out += ([r//n] if r%n == 0 else []) + [r*n]
        return out
    print([an for r in range(1, 13) for an in row(r)]) # Michael S. Branicky, Feb 02 2023

Formula

T(n, 1) = A008336(n+1).
T(n, A360299(n)) = A000142(n).
T(p, k) = p * T(p-1, k) for any prime number p.
Showing 1-1 of 1 results.