A377025 Squares and cubes that are not 6th powers.
4, 8, 9, 16, 25, 27, 36, 49, 81, 100, 121, 125, 144, 169, 196, 216, 225, 256, 289, 324, 343, 361, 400, 441, 484, 512, 529, 576, 625, 676, 784, 841, 900, 961, 1000, 1024, 1089, 1156, 1225, 1296, 1331, 1369, 1444, 1521, 1600, 1681, 1728, 1764, 1849, 1936, 2025
Offset: 1
Programs
-
Mathematica
lim=2025;Select[Union[Range[Floor[lim^(1/2)]]^2,Range[Floor[lim^(1/3)]]^3],!IntegerQ[#^(1/6)]&] (* James C. McMahon, Oct 16 2024 *)
-
Python
from math import isqrt from sympy import integer_nthroot def A377025(n): 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): return n+x+(integer_nthroot(x,6)[0]<<1)-integer_nthroot(x,3)[0]-isqrt(x) return bisection(f,n,n)
Comments