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.

A338409 a(n) is the number of nodes with depth of n in a binary tree defined as: root = 1 and a child (C) of a node (N) is such that A338215(C) = N. For nodes with two children, the smaller child is assigned as the left child and the bigger one as the right child. A child of a one-child node is assigned as the left child.

This page as a plain text file.
%I A338409 #10 Nov 23 2020 01:45:42
%S A338409 1,2,2,2,1,1,2,2,2,2,3,3,2,2,2,3,2,3,4,3,4,3,4,4,4,4,6,6,5,6,4,4,6,7,
%T A338409 7,6,7,6,5,4,6,7,8,8,8,8,10,8,8,8,9,10,8,9,11,13,11,9,12,11,10,11,11,
%U A338409 11,13,11,14,14,13,15,17,15,16,16,16,14,14,14
%N A338409 a(n) is the number of nodes with depth of n in a binary tree defined as: root = 1 and a child (C) of a node (N) is such that A338215(C) = N. For nodes with two children, the smaller child is assigned as the left child and the bigger one as the right child. A child of a one-child node is assigned as the left child.
%e A338409 The binary tree, read from left to right in the order of increasing depth n, is the positive integer sequence A000027. The first 67 numbers are shown in the figure below.
%e A338409     1
%e A338409   (2)\_3
%e A338409      (4)\_5
%e A338409          6 \_(7)
%e A338409         8
%e A338409        9
%e A338409     (10)\_11
%e A338409          12 \___________13
%e A338409         14            (15)
%e A338409        16 \______17
%e A338409      (18)\_19   20
%e A338409           21   22 \_(23)
%e A338409          24   25
%e A338409        (26)  27
%e A338409             28 \______29
%e A338409            30 \_(31) 32
%e A338409           33        34
%e A338409          35        36 \_____________________37
%e A338409        (38)       39                       40 \_(41)
%e A338409                  42 \______43             44
%e A338409                 45        46 \______47  (48)
%e A338409                49        50        51
%e A338409               52 \_(53) 54        55
%e A338409             (56)       57        58 \_(59)
%e A338409                       60 \_(61) 62   63
%e A338409                      64        65   66 \_67
%e A338409 All left children except 2 are composite numbers and all prime numbers are right children.
%o A338409 (Python)
%o A338409 from sympy import primepi
%o A338409 def depth(k):
%o A338409     d = 0
%o A338409     while k > 1:
%o A338409         k -= primepi(k)
%o A338409         k += primepi(k)
%o A338409         d += 1
%o A338409     return d
%o A338409 m = 1
%o A338409 for n in range (0, 101):
%o A338409     a = 0
%o A338409     while depth(m + a) == n:
%o A338409         a += 1
%o A338409     print(a)
%o A338409     m += a
%Y A338409 Cf. A000027, A062298, A095117, A338215, A338237, A338260.
%K A338409 nonn
%O A338409 0,2
%A A338409 _Ya-Ping Lu_, Oct 24 2020