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.

Showing 1-2 of 2 results.

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

Original entry on oeis.org

25, 121, 2187, 6431296, 6434856, 6956883693, 27027009001, 34359738368, 42618264157, 312078649600, 312079600999, 328080365089, 11305780833649, 11305786504384, 19287643015432, 62854896459664, 79723523012809
Offset: 1

Views

Author

Neil Fernandez, Oct 10 2002

Keywords

Examples

			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.
		

Crossrefs

Programs

  • Python
    from itertools import count, islice
    from sympy import mobius, integer_nthroot
    def A076433_gen(): # generator of terms
        def f(x): return int(x+sum(mobius(k)*(integer_nthroot(x,k)[0]-1) for k in range(2,x.bit_length())))
        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
        a = bisection(f)
        b = bisection(lambda x:f(x)+1,a,a)
        c = bisection(lambda x:f(x)+2,b,b)
        for i in count(3):
            d = bisection(lambda x:f(x)+i,c,c)
            if b-a > d-b:
                yield b
            a,b,c=b,c,d
    A076433_list = list(islice(A076433_gen(),5)) # Chai Wah Wu, Sep 09 2024

Extensions

More terms from Jud McCranie and Robert G. Wilson v, Oct 11 2002
a(6)-a(17) from Donovan Johnson, Sep 03 2008

A076431 Perfect powers for which the two closest perfect powers are smaller.

Original entry on oeis.org

9, 16, 36, 128, 144, 256, 361, 529, 1024, 1369, 1764, 2209, 2809, 3136, 3481, 5041, 5929, 6889, 8281, 9409, 10816, 12321, 13924, 16900, 17689, 19881, 22201, 24649, 27225, 29929, 33124, 36100, 39601, 43264, 51076, 55225, 59536, 64009, 69169
Offset: 1

Views

Author

Neil Fernandez, Oct 10 2002

Keywords

Examples

			The two closest perfect powers to 9 are 8 (difference = 1) and 4 (difference =5). The third closest is 16 (difference = 7). Both 8 and 4 are smaller than 9, so 9 is in the list.
		

Crossrefs

Showing 1-2 of 2 results.