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.
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
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
Links
- Rémy Sigrist, Table of n, a(n) for n = 1..11270 (rows for n = 1..26 flattened)
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
Comments