cp's OEIS Frontend

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.

A076433 Perfect powers for which the two closest perfect powers are greater.

This page as a plain text file.
%I A076433 #18 Sep 10 2024 00:24:15
%S A076433 25,121,2187,6431296,6434856,6956883693,27027009001,34359738368,
%T A076433 42618264157,312078649600,312079600999,328080365089,11305780833649,
%U A076433 11305786504384,19287643015432,62854896459664,79723523012809
%N A076433 Perfect powers for which the two closest perfect powers are greater.
%H A076433 Chai Wah Wu, <a href="/A076433/b076433.txt">Table of n, a(n) for n = 1..22</a>
%e A076433 The two closest perfect powers to 25 are 27 (difference = 2) and 32 (difference = 7). The third closest is 16 (difference = 9). Both 27 and 32 are greater than 25, so 25 is in the list.
%o A076433 (Python)
%o A076433 from itertools import count, islice
%o A076433 from sympy import mobius, integer_nthroot
%o A076433 def A076433_gen(): # generator of terms
%o A076433     def f(x): return int(x+sum(mobius(k)*(integer_nthroot(x,k)[0]-1) for k in range(2,x.bit_length())))
%o A076433     def bisection(f,kmin=0,kmax=1):
%o A076433         while f(kmax) > kmax: kmax <<= 1
%o A076433         while kmax-kmin > 1:
%o A076433             kmid = kmax+kmin>>1
%o A076433             if f(kmid) <= kmid:
%o A076433                 kmax = kmid
%o A076433             else:
%o A076433                 kmin = kmid
%o A076433         return kmax
%o A076433     a = bisection(f)
%o A076433     b = bisection(lambda x:f(x)+1,a,a)
%o A076433     c = bisection(lambda x:f(x)+2,b,b)
%o A076433     for i in count(3):
%o A076433         d = bisection(lambda x:f(x)+i,c,c)
%o A076433         if b-a > d-b:
%o A076433             yield b
%o A076433         a,b,c=b,c,d
%o A076433 A076433_list = list(islice(A076433_gen(),5)) # _Chai Wah Wu_, Sep 09 2024
%Y A076433 Cf. A001597, A053289, A075772, A076431, A076432.
%K A076433 nonn
%O A076433 1,1
%A A076433 _Neil Fernandez_, Oct 10 2002
%E A076433 More terms from _Jud McCranie_ and _Robert G. Wilson v_, Oct 11 2002
%E A076433 a(6)-a(17) from _Donovan Johnson_, Sep 03 2008