A358173 First differences of A286708.
36, 28, 8, 36, 52, 4, 16, 9, 63, 36, 68, 8, 32, 9, 43, 16, 76, 72, 27, 1, 108, 16, 64, 36, 68, 4, 28, 89, 36, 27, 4, 69, 71, 27, 29, 20, 72, 77, 47, 32, 128, 36, 36, 136, 8, 56, 25, 91, 188, 8, 188, 92, 9, 99, 4, 40, 144, 28, 109, 62, 49, 64, 49, 18, 97, 11, 81
Offset: 1
Keywords
Examples
The number 36 is the smallest powerful number that is not a prime power; the next powerful number that is not a prime power is 72, and their difference is 36, hence a(1) = 36.
Links
- Michael De Vlieger, Table of n, a(n) for n = 1..10000
- Michael De Vlieger, Scatterplot of a(n), n = 1..2^16, highlighting in red terms s that in A001694 are succeeded by a prime power t.
Programs
-
Mathematica
With[{nn = 2^25}, Differences@ Select[Rest@ Union@ Flatten@ Table[a^2*b^3, {b, nn^(1/3)}, {a, Sqrt[nn/b^3]}], ! PrimePowerQ[#] &]]
-
Python
from math import isqrt from sympy import integer_nthroot, primepi, mobius def A358173(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+1+sum(primepi(integer_nthroot(x, k)[0]) for k in range(2, x.bit_length())), 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 -(a:=bisection(f,n,n))+bisection(lambda x:f(x)+1,a,a) # Chai Wah Wu, Sep 10 2024
Comments