A386536 Exponent of the highest power of 2 dividing the n-th number that is cubefree but not squarefree.
2, 0, 2, 1, 2, 0, 2, 2, 2, 0, 0, 1, 2, 2, 0, 2, 0, 2, 2, 1, 2, 1, 0, 2, 2, 0, 0, 2, 1, 2, 2, 0, 2, 1, 0, 2, 2, 0, 0, 2, 0, 2, 2, 2, 1, 2, 0, 2, 2, 0, 2, 1, 2, 1, 2, 0, 2, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 1, 2, 0, 2, 0, 2, 0, 1, 2, 1, 2, 1, 2, 0, 0, 2, 0, 2, 2
Offset: 1
Links
- Amiram Eldar, Table of n, a(n) for n = 1..10000
Crossrefs
Programs
-
Mathematica
IntegerExponent[Select[Range[400], Max[FactorInteger[#][[;; , 2]]] == 2 &], 2]
-
PARI
list(lim) = for(k = 1, lim, if(k > 1 && vecmax(factor(k)[,2]) == 2, print1(valuation(k, 2), ", ")));
-
Python
from math import isqrt from sympy import integer_nthroot, mobius def A386536(n): def bisection(f,kmin=0,kmax=1): while f(kmax) > kmax: kmax <<= 1 while f(kmin) < kmin: kmin >>= 1 kmin = max(kmin,kmax >> 1) while kmax-kmin > 1: kmid = kmax+kmin>>1 if f(kmid) <= kmid: kmax = kmid else: kmin = kmid return kmax def f(x): return int(n+x+sum(mobius(k)*(x//k**2-x//k**3) for k in range(1, integer_nthroot(x,3)[0]+1))+sum(mobius(k)*(x//k**2) for k in range(integer_nthroot(x,3)[0]+1,isqrt(x)+1))) return ((m:=bisection(f,n,n))-1&~m).bit_length() # Chai Wah Wu, Jul 25 2025