%I #16 Sep 15 2024 22:02:12
%S 1,4,8,25,32,288,675,968,1152,1369,2700,9800,12167,39200,48668,70225,
%T 235224,332928,465124,1331712,1825200,5724500,7300800,11309768,
%U 78960996,189750625,263672644,384199200,592192224,912670088,1536796800,2368768896,4931691075,5425069447,8957108164
%N The smaller of a pair of successive powerful numbers without a nonsquarefree number between them.
%H Amiram Eldar, <a href="/A371190/b371190.txt">Table of n, a(n) for n = 1..64</a>
%H <a href="/index/Pow#powerful">Index entries for sequences related to powerful numbers</a>.
%e 1 is a term since 1 and 4 are successive powerful numbers and the numbers between them, 2 and 3, are both squarefree.
%t seq[max_] := Module[{pows = Union[Flatten[Table[i^2*j^3, {j, 1, Surd[max, 3]}, {i, 1, Sqrt[max/j^3]}]]], s = {}}, Do[If[AllTrue[Range[pows[[k]] + 1, pows[[k + 1]] - 1], SquareFreeQ], AppendTo[s, pows[[k]]]], {k, 1, Length[pows] - 1}]; s]; seq[10^10]
%o (PARI) lista(mx) = {my(s = List(), is); for(j = 1, sqrtnint(mx, 3), for(i = 1, sqrtint(mx\j^3), listput(s, i^2 * j^3))); s = Set(s); for(i = 1, #s - 1, is = 1; for(k = s[i]+1, s[i+1]-1, if(!issquarefree(k), is = 0; break)); if(is, print1(s[i], ", ")));}
%o (Python)
%o from math import isqrt
%o from sympy import mobius, integer_nthroot
%o def A371190_gen(): # generator of terms
%o def squarefreepi(n): return int(sum(mobius(k)*(n//k**2) for k in range(1, isqrt(n)+1)))
%o def bisection(f,kmin=0,kmax=1):
%o while f(kmax) > kmax: kmax <<= 1
%o while kmax-kmin > 1:
%o kmid = kmax+kmin>>1
%o if f(kmid) <= kmid:
%o kmax = kmid
%o else:
%o kmin = kmid
%o return kmax
%o def f(x):
%o c, l, j = x-squarefreepi(integer_nthroot(x,3)[0]), 0, isqrt(x)
%o while j>1:
%o k2 = integer_nthroot(x//j**2,3)[0]+1
%o w = squarefreepi(k2-1)
%o c -= j*(w-l)
%o l, j = w, isqrt(x//k2**3)
%o return c+l
%o m, w = 1, 1
%o for n in count(2):
%o k = bisection(lambda x:f(x)+n,m,m)
%o if (a:=squarefreepi(k))-w==k-1-m:
%o yield m
%o m, w = k, a # _Chai Wah Wu_, Sep 15 2024
%Y Cf. A001694, A005117, A013929, A240591.
%K nonn
%O 1,2
%A _Amiram Eldar_, Mar 14 2024