login
A396778
Perfect powers not representable as sums of two squares.
0
27, 216, 243, 343, 1331, 1728, 2187, 2744, 3375, 6859, 7776, 9261, 10648, 12167, 13824, 16807, 19683, 21952, 27000, 29791, 35937, 42875, 54872, 59319, 74088, 79507, 85184, 97336, 103823, 110592, 132651, 157464, 161051, 166375, 175616, 177147, 185193, 205379, 216000
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.
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
Subsequence of A001597.
Supersequence of A125111.
Disjoint from A000290.
Sequence in context: A183596 A033544 A224874 * A125111 A016767 A224354
KEYWORD
nonn,easy,new
AUTHOR
Felix Huber, Jun 18 2026
STATUS
approved