cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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.

Original entry on oeis.org

-1, 65, 1009, 6834, 1158224, 19198660, 1518471174, 301963223843, 14599274102522, 1601155487573222
Offset: 1

Views

Author

Ilya Gutkovskiy, Jul 01 2024

Keywords

Examples

			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.
		

Crossrefs

Programs

  • 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

Extensions

a(9)-a(10) from Robert Israel, Jul 01 2024