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.

This page as a plain text file.
%I A282578 #28 Dec 05 2021 10:32:12
%S A282578 12,5,5,3,62
%N A282578 Least k such that k^n is the sum of two distinct proper prime powers (A246547), or 0 if no such k exists.
%C A282578 Corresponding values of k^n are 12, 25, 125, 81, 916132832, ...
%H A282578 Wikipedia, <a href="http://en.wikipedia.org/wiki/Beal%27s_conjecture">Beal's conjecture</a>
%F A282578 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.
%e A282578 a(1) = 12 because 12 = 2^2 + 2^3.
%e A282578 a(2) = 5 because 5^2 = 2^4 + 3^2.
%e A282578 a(3) = 5 because 5^3 = 2^2 + 11^2.
%e A282578 a(4) = 3 because 3^4 = 2^5 + 7^2.
%e A282578 a(5) = 62 because 62^5 = 31^5 + 31^6.
%e A282578 a(9) = 2 because 2^9 = 7^3 + 13^2.
%o A282578 (Python)
%o A282578 from sympy import nextprime, perfect_power
%o A282578 def ppupto(limit): # distinct proper prime powers <= limit
%o A282578     p = 2; p2 = pk = p*p; pklist = []
%o A282578     while p2 <= limit:
%o A282578         while pk <= limit: pklist.append(pk); pk *= p
%o A282578         p = nextprime(p); p2 = pk = p*p
%o A282578     return sorted(pklist)
%o A282578 def sum_of_pp(n):
%o A282578     pp = ppupto(n); ppset = set(pp)
%o A282578     for p in pp:
%o A282578         if p > n//2: break
%o A282578         if n - p in ppset and n - p != p: return True
%o A282578     return False
%o A282578 def a(n):
%o A282578     k = 2
%o A282578     while not sum_of_pp(k**n): k += 1
%o A282578     return k
%o A282578 print([a(n) for n in range(1, 6)]) # _Michael S. Branicky_, Dec 05 2021
%Y A282578 Cf. A001597, A225102, A246547, A282550.
%K A282578 nonn,more
%O A282578 1,1
%A A282578 _Altug Alkan_, Feb 20 2017