OFFSET
1,2
EXAMPLE
a(2) = 65 = 1^2 + 8^2 = 4^2 + 7^2.
a(3) = 1009 = 1^3 + 2^3 + 10^3 = 4^3 + 6^3 + 9^3.
MAPLE
f:= proc(n) uses priqueue;
local pq, w, t, g, i, count, newt;
g:= proc(t) local i; [-add((t[i]+i)^n, i=1..n), op(t)] end proc;
w:= [0$(n+1)];
initialize(pq);
insert(g([0$n]), pq);
do
t:= extract(pq);
if t[1] = w[1] then return -t[1] fi;
w:= t;
for i from 2 to n+1 do
if t[i]=t[-1] then
newt:= g(t[2..-1] + [0$(i-2), 1$(n+2-i)]);
insert(newt, pq);
fi od od;
end proc:
-1, seq(f(n), n=2..10); # Robert Israel, Jul 01 2024
CROSSREFS
KEYWORD
sign,more
AUTHOR
Ilya Gutkovskiy, Jul 01 2024
EXTENSIONS
a(9)-a(10) from Robert Israel, Jul 01 2024
STATUS
approved