OFFSET
1,1
COMMENTS
Perfect powers m^k with odd k >= 3 such that m is not representable as a sum of two squares.
By Fermat's theorem on sums of two squares, this holds iff m contains a prime congruent to 3 mod 4 (A002145) with odd exponent.
Equivalently, these are perfect powers m^k with odd exponent k such that m is in A022544.
No squares occur in this sequence.
This sequence generalizes A125111, which corresponds to the case k = 3.
LINKS
Felix Huber, Table of n, a(n) for n = 1..10000
Wikipedia, Fermat's theorem on sums of two squares.
FORMULA
a(n) are the numbers m^k with k >= 3 odd such that m is in A022544.
EXAMPLE
216 = 6^3 is a term, since 6 contains the prime 3 == 3 (mod 4) to odd exponent; hence 216 is not representable as a sum of two squares.
16807 = 7^5 is a term, since 7 is congruent to 3 mod 4 and occurs to odd exponent; hence 16807 is not representable as a sum of two squares.
MAPLE
A396778List := proc(N)
local b, l, p, k, m, r, t;
b := table(); l := floor(N^(1/3));
for m from 2 to l do b[m] := false end do;
for p from 3 to l do
if isprime(p) and p mod 4 = 3 then
for k from 1 to floor(log(l)/log(p)) do
if k mod 2 = 1 then
for m from p^k to l by p^k do
if irem(m, p^(k + 1)) <> 0 then b[m] := true end if
end do
end if
end do
end if
end do;
t := table();
for m from 2 to l do
if b[m] then
r := m^3;
while r <= N do
t[r] := true; r := r*m^2
end do
end if
end do;
return sort([indices(t, 'nolist')])
end proc:
A396778List(216000);
MATHEMATICA
With[{nn = 2^18}, Union@ Flatten[Table[If[SquaresR[2, #] == 0, #, Nothing] &[k^m], {m, 2, Log2[nn]}, {k, 2, Surd[nn, m]} ] ] ] (* Michael De Vlieger, Jun 18 2026 *)
CROSSREFS
KEYWORD
nonn,easy,new
AUTHOR
Felix Huber, Jun 18 2026
STATUS
approved
