A293441 a(n) is the number of odd numbers k in range [2^n, (2^(n+1))-1] such that all terms in finite sequence [k, floor(k/2), floor(k/4), floor(k/8), ..., 1] are squarefree.
1, 1, 2, 3, 4, 5, 7, 8, 11, 15, 20, 29, 37, 47, 67, 84, 120, 152, 202, 268, 351, 469, 640, 859, 1150, 1560, 2071, 2801, 3753, 5078, 6743, 9132, 12232, 16379, 22010, 29601, 39694, 53450, 71840, 96380, 129668, 174059, 234111, 314402, 422498, 567724, 762488, 1024579, 1376675, 1850127, 2485463, 3339795
Offset: 0
Keywords
Crossrefs
Programs
-
Mathematica
Table[Count[Range[2^n + 1, (2^(n + 1)) - 1, 2], ?(AllTrue[ Table[Floor[#/2^e], {e, 0, n}], SquareFreeQ] &)], {n, 0, 20}] (* _Michael De Vlieger, Oct 10 2017 *)
-
PARI
\\ A naive algorithm: up_to_level = 28; up_to = (2^(1+up_to_level)); is_persistently_squarefree(n,base) = { while(n>1, if(!issquarefree(n),return(0)); n \= base); (1); }; is_oddA293430(n) = ((n%2)&&is_persistently_squarefree(n,2)); countsA293441 = 1; k=1; for(n=2,up_to,if(!bitand(n,n-1), write("b293441.txt", k, " ", countsA293441); print1(countsA293441,", "); countsA293441 = 0; k++); if(is_oddA293430(n),countsA293441++));
-
PARI
\\ Faster way, compute 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 (A293441 n) (add (lambda (k) (* (A000035 k) (abs (A293233 k)))) (A000079 n) (+ -1 (A000079 (+ 1 n)))))
Comments