OFFSET
1,1
COMMENTS
A134422 is a subsequence.
Obviously, this sequence contains all numbers of the form 2^(2*n+1), for n > 0.
Motivation for this sequence is the equation m^k = x^2 + y^2 where m,x,y > 0, k >= 2. - Altug Alkan, Jan 11 2016
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
25 is a term because 25 = 5^2 = 3^2 + 4^2.
32 is a term because 32 = 2^5 = 4^2 + 4^2.
125 is a term because 125 = 5^3 = 10^2 + 5^2.
169 is a term because 169 = 13^2 = 5^2 + 12^2.
MAPLE
N:= 10000: # to get all terms <= N
g:= proc(k)
local F, F1, F2, F3, f;
F:= ifactors(k)[2];
F2, F:= selectremove(f->f[1]=2, F);
F1, F3:= selectremove(f -> f[1] mod 4 = 1, F);
if F1 <> [] then
if hastype(map(f -> f[2], F3), odd) then
seq(k^j, j=2..floor(log[k](N)), 2)
else seq(k^j, j=2..floor(log[k](N)))
fi
elif F2 = [] or F2[1][2]::even or hastype(map(f -> f[2], F3), odd) then NULL
else seq(k^j, j=3..floor(log[k](N)), 2)
fi
end proc:
sort(convert(map(g, {$2..floor(sqrt(N))}), list)); # Robert Israel, Jan 11 2016
MATHEMATICA
lim = 7600; fQ[n_] := n == 1 || GCD @@ FactorInteger[n][[All, 2]] > 1; Select[Union@ Flatten@ Table[a^2 + b^2, {a, Floor[Sqrt[lim - 1]]}, {b, a, Floor[Sqrt[lim - a^2]]}], fQ] (* Michael De Vlieger, Jan 06 2016, after N. J. A. Sloane and J. H. Conway at A000404 and Ant King at A001597 *)
PROG
(PARI) is(n) = {for( i=1, #n=factor(n)~%4, n[1, i]==3 && n[2, i]%2 && return); n && ( vecmin(n[1, ])==1 || (n[1, 1]==2 && n[2, 1]%2))}
for(n=1, 1e4, if((ispower(n) || n==1) && is(n), print1(n, ", ")));
CROSSREFS
KEYWORD
nonn
AUTHOR
Altug Alkan, Jan 06 2016
STATUS
approved