OFFSET
1,2
COMMENTS
LINKS
Rémy Sigrist, Table of n, a(n) for n = 1..11270 (rows for n = 1..26 flattened)
FORMULA
EXAMPLE
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
PROG
(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
CROSSREFS
KEYWORD
AUTHOR
Rémy Sigrist, Feb 02 2023
STATUS
approved