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.

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