cp's OEIS Frontend

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.

A386536 Exponent of the highest power of 2 dividing the n-th number that is cubefree but not squarefree.

This page as a plain text file.
%I A386536 #13 Jul 25 2025 14:23:40
%S A386536 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,
%T A386536 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,
%U A386536 1,2,0,2,0,2,0,1,2,1,2,1,2,0,0,2,0,2,2
%N A386536 Exponent of the highest power of 2 dividing the n-th number that is cubefree but not squarefree.
%H A386536 Amiram Eldar, <a href="/A386536/b386536.txt">Table of n, a(n) for n = 1..10000</a>
%F A386536 a(n) = A007814(A067259(n)).
%F A386536 Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = (4/(7*zeta(3)) - 1/(3*zeta(2)))/(1/zeta(3) - 1/zeta(2)) = 1.2176665... .
%t A386536 IntegerExponent[Select[Range[400], Max[FactorInteger[#][[;; , 2]]] == 2 &], 2]
%o A386536 (PARI) list(lim) = for(k = 1, lim, if(k > 1 && vecmax(factor(k)[,2]) == 2, print1(valuation(k, 2), ", ")));
%o A386536 (Python)
%o A386536 from math import isqrt
%o A386536 from sympy import integer_nthroot, mobius
%o A386536 def A386536(n):
%o A386536     def bisection(f,kmin=0,kmax=1):
%o A386536         while f(kmax) > kmax: kmax <<= 1
%o A386536         while f(kmin) < kmin: kmin >>= 1		
%o A386536         kmin = max(kmin,kmax >> 1)
%o A386536         while kmax-kmin > 1:
%o A386536             kmid = kmax+kmin>>1
%o A386536             if f(kmid) <= kmid:
%o A386536                 kmax = kmid
%o A386536             else:
%o A386536                 kmin = kmid
%o A386536         return kmax
%o A386536     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)))
%o A386536     return ((m:=bisection(f,n,n))-1&~m).bit_length() # _Chai Wah Wu_, Jul 25 2025
%Y A386536 Cf. A002117, A013661, A007814, A067259.
%Y A386536 Similar sequences: A383004, A383005, A383006, A383007, A383029, A383032, A386537.
%K A386536 nonn,easy
%O A386536 1,1
%A A386536 _Amiram Eldar_, Jul 25 2025