login
A293518
Number of surviving even nodes at generation n in the binary tree of persistently squarefree numbers (see A293230).
6
0, 1, 1, 2, 2, 2, 3, 6, 6, 8, 12, 16, 20, 31, 34, 56, 63, 88, 112, 150, 208, 287, 379, 511, 690, 908, 1239, 1637, 2252, 2945, 4052, 5348, 7203, 9681, 12974, 17432, 23470, 31419, 42254, 57026, 76182, 102845, 137764, 185271, 249065, 334864, 449586, 604164, 811709, 1089661, 1465433, 1968592
OFFSET
0,4
FORMULA
a(n) = Sum_{k=(2^n)..(2^(1+n))-1)] abs(A293233(k)) * [0==(A008966(2k)] * [1==A008966(1+2k))].
a(n) + A293519(n) = A293521(n).
a(n) - A293519(n) = A293517(n).
EXAMPLE
a(3) = 2 because in the binary tree illustrated in A293230, there are two even nodes at the level 3 (namely, the nodes 10 and 14) that spawn just one offspring each.
PROG
(PARI)
\\ Compute the sequences A293441, A293518 and A293519 at the same time:
allocatemem(2^30);
next_living_bud_or_zero(n) = if(issquarefree(n), n, 0);
nextA293230generation(tops) = { my(new_tops = vecsort(vector(2*#tops, i, next_living_bud_or_zero((2*tops[(i+1)\2])+((i+1)%2))), , 8)); if(0==new_tops[1], vector(#new_tops-1, i, new_tops[1+i]), new_tops); }
writeA293441etc_counts(n, tops) = { my(os=0, es=0, k=0); for(i=1, #tops, if((tops[i]%2), k++; if(!issquarefree(1+(2*tops[i])), os++), if(issquarefree(1+(2*tops[i])), es++)); ); write("b293441.txt", n, " ", k); write("b293518.txt", n, " ", es); write("b293519.txt", n, " ", os); print1(k, ", "); }
tops_of_tree = [1];
write("b293441.txt", 0, " ", 1);
write("b293518.txt", 0, " ", 0);
write("b293519.txt", 0, " ", 0);
print1(1, ", ");
for(n=1, 51, tops_of_tree = nextA293230generation(tops_of_tree); writeA293441etc_counts(n, tops_of_tree); );
(Scheme)
(define (A293518 n) (add (lambda (k) (* (if (and (= 0 (A008966 (+ k k))) (= 1 (A008966 (+ 1 k k)))) 1 0) (abs (A293233 k)))) (A000079 n) (+ -1 (A000079 (+ 1 n)))))
;; Implements sum_{i=lowlim..uplim} intfun(i)
(define (add intfun lowlim uplim) (let sumloop ((i lowlim) (res 0)) (cond ((> i uplim) res) (else (sumloop (1+ i) (+ res (intfun i)))))))
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Oct 16 2017
STATUS
approved