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.

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.

This page as a plain text file.
%I A360298 #12 Feb 02 2023 14:41:03
%S A360298 1,2,6,24,120,20,720,140,5040,1120,630,40320,10080,70,5670,4480,
%T A360298 362880,1008,100800,7,700,567,56700,448,44800,36288,3628800,11088,
%U A360298 1108800,77,7700,6237,623700,4928,492800,399168,39916800,924,133056,92400,13305600,924,92400,74844,51975,7484400,59136,5913600,33264,4790016,3326400,479001600
%N 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.
%C A360298 This sequence is a variant of A360173; here we use divisions and multiplications, there subtractions and additions.
%C A360298 The n-th row has A360299(n) terms, starts with A008336(n+1) and ends with A000142(n).
%H A360298 Rémy Sigrist, <a href="/A360298/b360298.txt">Table of n, a(n) for n = 1..11270</a> (rows for n = 1..26 flattened)
%F A360298 T(n, 1) = A008336(n+1).
%F A360298 T(n, A360299(n)) = A000142(n).
%F A360298 T(p, k) = p * T(p-1, k) for any prime number p.
%e A360298 The tree begins:
%e A360298   n     n-th row
%e A360298   --    --------
%e A360298    1    1___
%e A360298             |
%e A360298    2        2___
%e A360298                 |
%e A360298    3            6___
%e A360298                     |
%e A360298    4               24___
%e A360298                         |
%e A360298    5      _____________120_____________
%e A360298          |                             |
%e A360298    6    20___                         720___
%e A360298              |                              |
%e A360298    7        140___                   _____5040_____
%e A360298                   |                 |              |
%e A360298    8            1120__           __630__       __40320__
%e A360298                       |         |       |     |         |
%e A360298    9                10080      70     5670  4480     362880
%o A360298 (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) }
%o A360298 (Python)
%o A360298 from functools import cache
%o A360298 @cache
%o A360298 def row(n):
%o A360298     if n == 1: return [1]
%o A360298     out = []
%o A360298     for r in row(n-1): out += ([r//n] if r%n == 0 else []) + [r*n]
%o A360298     return out
%o A360298 print([an for r in range(1, 13) for an in row(r)]) # _Michael S. Branicky_, Feb 02 2023
%Y A360298 Cf. A000142, A008336, A360173, A360299 (row lengths), A360300.
%K A360298 nonn,look,tabf,easy
%O A360298 1,2
%A A360298 _Rémy Sigrist_, Feb 02 2023