A384517 Nonsquarefree numbers that are squarefree numbers raised to an even power.
4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 169, 196, 225, 256, 289, 361, 441, 484, 529, 625, 676, 729, 841, 900, 961, 1024, 1089, 1156, 1225, 1296, 1369, 1444, 1521, 1681, 1764, 1849, 2116, 2209, 2401, 2601, 2809, 3025, 3249, 3364, 3481, 3721, 3844, 4096, 4225, 4356
Offset: 1
Keywords
Links
Crossrefs
Programs
-
Mathematica
Select[Range[2, 100], SameQ @@ FactorInteger[#][[;;, 2]] &]^2
-
PARI
isok(k) = {my(s, e = ispower(k, , &s)); !(e % 2) && issquarefree(s);}
-
Python
from math import isqrt from sympy import mobius, integer_nthroot def A384517(n): def bisection(f,kmin=0,kmax=1): while f(kmax) > kmax: kmax <<= 1 kmin = kmax >> 1 while kmax-kmin > 1: kmid = kmax+kmin>>1 if f(kmid) <= kmid: kmax = kmid else: kmin = kmid return kmax def g(x): return sum(mobius(k)*(x//k**2) for k in range(1, isqrt(x)+1)) def f(x): return n+x-sum(g(integer_nthroot(x,e)[0])-1 for e in range(2,x.bit_length(),2)) return bisection(f,n,n) # Chai Wah Wu, Jun 01 2025
Comments