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.
%I A336178 #12 Sep 15 2024 22:01:48 %S A336178 31,36,67,93,132,140,145,161,166,189,192,220,223,265,280,290,296,311, %T A336178 316,322,364,384,407,468,537,576,592,602,623,639,644,656,659,661,670, %U A336178 690,722,769,771,793,828,883,888,890,896,950,961,981,984,987,992,995,1018 %N A336178 Numbers k such that there are exactly three powerful numbers between k^2 and (k+1)^2. %C A336178 Positions of 3's in A119241. %C A336178 Shiu (1980) proved that this sequence has an asymptotic density = 0.0770... A more accurate calculation using his formula gives 0.0770742722233... %D A336178 József Sándor, Dragoslav S. Mitrinovic and Borislav Crstici, Handbook of Number Theory I, Springer Science & Business Media, 2005, chapter VI, p. 226. %H A336178 Amiram Eldar, <a href="/A336178/b336178.txt">Table of n, a(n) for n = 1..10000</a> %H A336178 P. Shiu, <a href="https://doi.org/10.1112/S0025579300010056">On the number of square-full integers between successive squares</a>, Mathematika, Vol. 27, No. 2 (1980), pp. 171-178. %e A336178 31 is a term since there are exactly three powerful numbers, 968 = 2^3 * 11^2, 972 = 2^2 * 3^5 and 1000 = 2^3 * 5^3 between 31^2 = 961 and (31+1)^2 = 1024. %t A336178 powQ[n_] := (n == 1) || Min @@ FactorInteger[n][[;; , 2]] > 1; Select[Range[1000], Count[Range[#^2 + 1, (# + 1)^2 - 1], _?powQ] == 3 &] %o A336178 (Python) %o A336178 from functools import lru_cache %o A336178 from math import isqrt %o A336178 from sympy import mobius, integer_nthroot %o A336178 def A336178(n): %o A336178 def squarefreepi(n): return int(sum(mobius(k)*(n//k**2) for k in range(1, isqrt(n)+1))) %o A336178 def bisection(f,kmin=0,kmax=1): %o A336178 while f(kmax) > kmax: kmax <<= 1 %o A336178 while kmax-kmin > 1: %o A336178 kmid = kmax+kmin>>1 %o A336178 if f(kmid) <= kmid: %o A336178 kmax = kmid %o A336178 else: %o A336178 kmin = kmid %o A336178 return kmax %o A336178 @lru_cache(maxsize=None) %o A336178 def g(x): %o A336178 c, l = 0, 0 %o A336178 j = isqrt(x) %o A336178 while j>1: %o A336178 k2 = integer_nthroot(x//j**2,3)[0]+1 %o A336178 w = squarefreepi(k2-1) %o A336178 c += j*(w-l) %o A336178 l, j = w, isqrt(x//k2**3) %o A336178 c += squarefreepi(integer_nthroot(x,3)[0])-l %o A336178 return c %o A336178 def f(x): %o A336178 c, a = n+x, 1 %o A336178 for k in range(1,x+1): %o A336178 b = g((k+1)**2) %o A336178 if b == a+4: %o A336178 c -= 1 %o A336178 a = b %o A336178 return c %o A336178 return bisection(f,n,n) # _Chai Wah Wu_, Sep 14 2024 %Y A336178 Cf. A001694, A119241, A119242, A336175, A336176, A336177. %K A336178 nonn %O A336178 1,1 %A A336178 _Amiram Eldar_, Jul 10 2020