A338237 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 C - primepi(C) = N, or A062298(C) = N. For a node with two children, the smaller child is assigned as the left child and the bigger one as the right child. Otherwise, the child is assigned as the left child.
1, 2, 4, 6, 8, 11, 15, 18, 24, 30, 36, 46, 54, 66, 78, 94, 110, 130, 154, 179, 205, 240, 278, 317, 365, 418, 474, 539, 612, 692, 783, 885, 993, 1116, 1254, 1399, 1570, 1752, 1950, 2166, 2408, 2690, 2976, 3287, 3644, 4023, 4449, 4892, 5391, 5946, 6523, 7169
Offset: 0
Keywords
Links
- Michael De Vlieger, Table of n, a(n) for n = 0..150
Programs
-
Mathematica
c = q = 0; w = {}; Do[Set[a[i], If[PrimeQ[i], c++, a[i - c]]]; q++; If[a[i] == 0, AppendTo[w, q]; q = 0], {i, 2, 10^5}]; Most[w] (* Michael De Vlieger, Nov 04 2021 *)
-
Python
from sympy import primepi def depth(k): d = 0 while k > 1: k -= primepi(k) d += 1 return d m = 1 for n in range (0, 101): a = 0 while depth(m + a) == n: a += 1 print(a) m += a
Comments