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.

A282578 Least k such that k^n is the sum of two distinct proper prime powers (A246547), or 0 if no such k exists.

Original entry on oeis.org

12, 5, 5, 3, 62
Offset: 1

Views

Author

Altug Alkan, Feb 20 2017

Keywords

Comments

Corresponding values of k^n are 12, 25, 125, 81, 916132832, ...

Examples

			a(1) = 12 because 12 = 2^2 + 2^3.
a(2) = 5 because 5^2 = 2^4 + 3^2.
a(3) = 5 because 5^3 = 2^2 + 11^2.
a(4) = 3 because 3^4 = 2^5 + 7^2.
a(5) = 62 because 62^5 = 31^5 + 31^6.
a(9) = 2 because 2^9 = 7^3 + 13^2.
		

Crossrefs

Programs

  • Python
    from sympy import nextprime, perfect_power
    def ppupto(limit): # distinct proper prime powers <= limit
        p = 2; p2 = pk = p*p; pklist = []
        while p2 <= limit:
            while pk <= limit: pklist.append(pk); pk *= p
            p = nextprime(p); p2 = pk = p*p
        return sorted(pklist)
    def sum_of_pp(n):
        pp = ppupto(n); ppset = set(pp)
        for p in pp:
            if p > n//2: break
            if n - p in ppset and n - p != p: return True
        return False
    def a(n):
        k = 2
        while not sum_of_pp(k**n): k += 1
        return k
    print([a(n) for n in range(1, 6)]) # Michael S. Branicky, Dec 05 2021

Formula

a(p) <= 2 * (2^p - 1) where p is in A000043 since (2^p - 1)^p + (2^p - 1)^(p + 1) = (2 * (2^p - 1))^p.