OFFSET
0,4
COMMENTS
Also, number of nodes on level n (the root 1 occurs at level 0) of binary tree depicted in A005940 where the left hand child is larger than the right hand child of the node.
E.g. on the level 2, containing nodes 3 and 4, the children of 3 are 5 < 6, and the children of 4 are 9 > 8, thus a(2) = 1.
FORMULA
PROG
(PARI)
allocatemem(234567890);
A003961(n) = my(f = factor(n)); for (i=1, #f~, f[i, 1] = nextprime(f[i, 1]+1)); factorback(f); \\ Using code of Michel Marcus
A252745print(up_to_n) = { my(s, i=0, n=0); for(n=0, up_to_n, if(0 == n, s = 0; lev = vector(1); lev[1] = 2, oldlev = lev; lev = vector(2*length(oldlev)); s = 0; for(i = 0, (2^n)-1, lev[i+1] = if(!(i%2), A003961(oldlev[(i\2)+1]), 2*oldlev[(i\2)+1]); s += if((i%2), (lev[i+1] < lev[i]), 0))); write("b252745.txt", n, " ", s)); };
A252745print(23); \\ The terms a(0) .. a(23) were computed with this program.
(Scheme)
(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, Dec 21 2014
STATUS
approved