OFFSET
1,2
COMMENTS
First differs from A340588 at n = 12.
4-full (or 3-full) squares.
Numbers whose exponents in their prime factorization are all even numbers >= 4.
This sequence is closed under multiplication.
LINKS
FORMULA
MATHEMATICA
powQ[n_] := n==1 || AllTrue[FactorInteger[n][[;; , 2]], # > 1 &]; Select[Range[600], powQ]^2
PROG
(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
CROSSREFS
Subsequence of A322449.
KEYWORD
nonn,easy
AUTHOR
Amiram Eldar, Jul 02 2024
STATUS
approved