A374291 Squares of powerful numbers.
1, 16, 64, 81, 256, 625, 729, 1024, 1296, 2401, 4096, 5184, 6561, 10000, 11664, 14641, 15625, 16384, 20736, 28561, 38416, 40000, 46656, 50625, 59049, 65536, 82944, 83521, 104976, 117649, 130321, 153664, 160000, 186624, 194481, 234256, 250000, 262144, 279841, 331776
Offset: 1
Links
Crossrefs
Programs
-
Mathematica
powQ[n_] := n==1 || AllTrue[FactorInteger[n][[;; , 2]], # > 1 &]; Select[Range[600], powQ]^2
-
PARI
is(k) = issquare(k) && ispowerful(sqrtint(k));
-
Python
from math import isqrt from sympy import mobius, integer_nthroot def A374291(n): def squarefreepi(n): return int(sum(mobius(k)*(n//k**2) for k in range(1, isqrt(n)+1))) def bisection(f, kmin=0, kmax=1): while f(kmax) > kmax: kmax <<= 1 while kmax-kmin > 1: kmid = kmax+kmin>>1 if f(kmid) <= kmid: kmax = kmid else: kmin = kmid return kmax def f(x): c, l = n+x, 0 j = isqrt(x) while j>1: k2 = integer_nthroot(x//j**2, 3)[0]+1 w = squarefreepi(k2-1) c -= j*(w-l) l, j = w, isqrt(x//k2**3) c -= squarefreepi(integer_nthroot(x, 3)[0])-l return c return bisection(f,n,n)**2 # Chai Wah Wu, Sep 10 2024
Comments