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.
%I A341742 #15 Mar 18 2021 05:46:26 %S A341742 1,2,4,8,9,16,18,32,36,33,64,72,66,65,128,144,132,130,129,256,145,288, %T A341742 133,264,260,258,512,290,289,576,266,265,528,261,520,259,516,513,1024, %U A341742 291,580,578,1152,267,532,530,529,1056,522,1040,518,517,1032,1026 %N A341742 Nodes read by depth in a binary tree defined as: Root = 1; an even node N has a left child N + 1 if N + 1 is not a prime, and an odd node N has a left child sqrt(N + 2) if sqrt(N + 2) is a prime; the right child of a node N is 2*N. %C A341742 Let d be the depth of a node N in the binary tree and f be the map of A340801. The d-th iteration of map A340801 on N gives 1, or f^d(N) = 1. %C A341742 If Conjectures 1 and 2 made in A340801 hold, the sequence contains all positive integers and each integer appears once in the sequence. %C A341742 The first odd prime does not appear until d reaches 30 and the first five odd primes appearing in the sequence are: %C A341742 n a(n) d %C A341742 ------- ----- -- %C A341742 140735 4099 30 %C A341742 151872 1543 31 %C A341742 1574120 8689 36 %C A341742 1841645 2917 36 %C A341742 2111465 32771 36 %C A341742 The first two odd primes less than 100 appear in the binary tree are 17 at d = 4426 and 71 at d = 4421. %e A341742 The binary tree for depths up to 9 is given below. %e A341742 1 %e A341742 \ %e A341742 2 %e A341742 \ %e A341742 4 %e A341742 \ %e A341742 8 %e A341742 / \ %e A341742 9 16 %e A341742 \ \ %e A341742 18 32 %e A341742 \ / \ %e A341742 36 33 64 %e A341742 \ \ / \ %e A341742 72 66 65 128 %e A341742 \ \ \ / \ %e A341742 144 132 130 129 256 %e A341742 / \ / \ \ \ \ %e A341742 145 288 133 264 260 258 512 %o A341742 (Python) %o A341742 from sympy import isprime %o A341742 from math import sqrt %o A341742 def children(N): %o A341742 C = [] %o A341742 if N%2 == 0: %o A341742 if isprime(N + 1) == 0: C.append(N+1) %o A341742 else: %o A341742 p1 = sqrt(N + 2.0); p2 = int(p1 + 0.5) %o A341742 if p2**2 == N + 2 and isprime(p2) == 1: C.append(p2) %o A341742 C.append(2*N) %o A341742 return C %o A341742 L_last = [1]; print(L_last) %o A341742 for d in range(1, 18): %o A341742 L_1 = [] %o A341742 for i in range(0, len(L_last)): %o A341742 C_i = children(L_last[i]) %o A341742 for j in range(0, len(C_i)): L_1.append(C_i[j]) %o A341742 print(L_1); L_last = L_1 %Y A341742 Cf. A340801, A006577, A340008, A339991, A340419. %K A341742 nonn %O A341742 1,2 %A A341742 _Ya-Ping Lu_, Feb 18 2021