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).

This page as a plain text file.
%I A304432 #15 Dec 02 2024 12:19:13
%S A304432 5,6,9,10,12,13,14,15,17,18,20,21,24,25,26,28,29,30,33,34,35,36,37,39,
%T A304432 40,41,42,43,45,48,50,51,52,53,54,55,57,58,60,61,62,63,65,66,68,70,71,
%U A304432 72,73,74,75,76,78,80,81,82,85,87,89,90,91,95,96,97,98,99,100
%N 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).
%H A304432 Michael De Vlieger, <a href="/A304432/b304432.txt">Table of n, a(n) for n = 1..10000</a>
%e A304432 5^2 = 25 = 3^2 + 4^2; 6^2 = 3^2 + 3^3; 9^2 = 2^5 + 7^2, ...
%t A304432 n = 120; i = 1;
%t A304432 s = Select[Union@ Flatten@ Table[a^2*b^3, {b, Surd[nn, 3]}, {a, Sqrt[nn/b^3]}],
%t A304432   GCD @@ FactorInteger[#][[All, -1]] > 1 &];
%t A304432 m = Length[s];
%t A304432 Union@ Reap[
%t A304432   While[i <= m, j = i + 1;
%t A304432     While[k = s[[i]] + s[[j]]; k <= nn,
%t A304432       If[And[IntegerQ@ Sqrt[k], i != j],
%t A304432       Sow[Sqrt[k]]]; j++];
%t A304432 i++] ][[-1, 1]] (* _Michael De Vlieger_, Dec 02 2024 *)
%o A304432 (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}.
%o A304432 (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
%Y A304432 Cf. A001597 (perfect powers), A282550.
%K A304432 nonn
%O A304432 1,1
%A A304432 _M. F. Hasler_, May 13 2018