login
A374256
a(n) is the smallest number which can be represented as the sum of n distinct positive n-th powers in exactly 2 ways, or -1 if no such number exists.
3
-1, 65, 1009, 6834, 1158224, 19198660, 1518471174, 301963223843, 14599274102522, 1601155487573222
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