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-3 of 3 results.

A285438 Perfect powers that are also the sum of two powers of a prime p.

Original entry on oeis.org

4, 8, 9, 16, 32, 36, 64, 128, 144, 256, 324, 512, 576, 1024, 2048, 2304, 2744, 2916, 4096, 8192, 9216, 16384, 26244, 32768, 36864, 65536, 131072, 147456, 236196, 262144, 524288, 589824, 941192, 1048576, 2097152, 2125764, 2359296, 4194304, 8388608, 9437184
Offset: 1

Views

Author

Michael Josephy, Apr 18 2017

Keywords

Comments

Integers n such that there exist integers i, j, k, m, p with i, j >= 0, m, k >= 2 and p prime, such that n = m^k = p^i + p^j.
These are numbers of the form 2^r = 2^(r-1) + 2^(r-1) when r >= 2, numbers of the form (3*2^r)^2 = 2^(2*r) + 2^(2*r+3) and numbers of the form (2*p^r)^k = p^(r*k) + p^(r*k+1) when p = 2^k - 1 is a Mersenne prime. [Edited by Jinyuan Wang, Nov 30 2019]
If n = p^i + p^j is a term with exactly two sets of integer solutions (p, i, j), where i <= j, then n must be 36 = 6^2 = 2^2 + 2^5 = 3^2 + 3^3 or of the form 2^k = 2^(k-1) + 2^(k-1) = p^0 + p^1 where p = 2^k - 1 is a Mersenne prime. There is no n = p^i + p^j in this sequence with at least three sets of integer solutions (p, i, j), where i <= j. - Jinyuan Wang, Nov 30 2019

Examples

			324 = 18^2 = 3^4 + 3^5.
		

Crossrefs

Programs

  • Maple
    N:= 10^9: # to get all terms <= N
    R1:= {seq(2^i,i=2..ilog2(N))}:
    R2:= {seq(9*2^(2*r), r=0..ilog2(floor(N/9))/2)}:
    R3:= {seq(seq(2^k*(2^k-1)^(r*k),r=1..floor(log[2^k-1](N/2^k)/k)),k=select(t -> isprime(2^t-1),[$2..ilog2(N)]))}:
    sort(convert(R1 union R2 union R3, list)); # Robert Israel, Apr 25 2017
  • PARI
    upto(nn) = {my(v=List([]), k=1); for(r=2, logint(nn, 2), listput(v, 2^r)); for(r=0, logint(nn\9, 4), listput(v, 9*4^r)); while((2*2^k-2)^kJinyuan Wang, Nov 30 2019

Extensions

a(19)-a(40) from Robert Israel, Apr 25 2017

A304432 Numbers n such that n^2 is the sum of two distinct perfect powers > 1 (x^k + y^m; x, y, k, m >= 2).

Original entry on oeis.org

5, 6, 9, 10, 12, 13, 14, 15, 17, 18, 20, 21, 24, 25, 26, 28, 29, 30, 33, 34, 35, 36, 37, 39, 40, 41, 42, 43, 45, 48, 50, 51, 52, 53, 54, 55, 57, 58, 60, 61, 62, 63, 65, 66, 68, 70, 71, 72, 73, 74, 75, 76, 78, 80, 81, 82, 85, 87, 89, 90, 91, 95, 96, 97, 98, 99, 100
Offset: 1

Views

Author

M. F. Hasler, May 13 2018

Keywords

Examples

			5^2 = 25 = 3^2 + 4^2; 6^2 = 3^2 + 3^3; 9^2 = 2^5 + 7^2, ...
		

Crossrefs

Cf. A001597 (perfect powers), A282550.

Programs

  • Mathematica
    n = 120; i = 1;
    s = Select[Union@ Flatten@ Table[a^2*b^3, {b, Surd[nn, 3]}, {a, Sqrt[nn/b^3]}],
      GCD @@ FactorInteger[#][[All, -1]] > 1 &];
    m = Length[s];
    Union@ Reap[
      While[i <= m, j = i + 1;
        While[k = s[[i]] + s[[j]]; k <= nn,
          If[And[IntegerQ@ Sqrt[k], i != j],
          Sow[Sqrt[k]]]; j++];
    i++] ][[-1, 1]] (* Michael De Vlieger, Dec 02 2024 *)
  • PARI
    is(n)=for(i=2,(n^2-1)\2, ispower(i)&&ispower(n^2-i)&&return(i)) \\ For more efficiency, loop over elements of precomputed A001597\{1}.
    
  • PARI
    L=100; PP=List(); a=Set(); for(n=1,L^2, ispower(n)||next; for(i=1,#PP, issquare(n+PP[i],&m)&& m<=L&&  a=setunion(a,[m])); listput(PP,n)); a

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.
Showing 1-3 of 3 results.