

A252897


Rainbow Squares: a(n) = number of ways to pair the integers 1 to 2n so that the sum of each pair is a square.


4



1, 0, 0, 0, 1, 0, 0, 1, 1, 1, 0, 0, 1, 6, 18, 12, 36, 156, 295, 429, 755, 2603, 7122, 19232, 32818, 54363, 172374, 384053, 933748, 1639656, 4366714, 20557751, 83801506, 188552665, 399677820, 640628927, 2175071240, 8876685569, 32786873829, 108039828494
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

0,14


COMMENTS

The original sequence is from Henri Picciotto who asked for which n is such a pairing possible: A253472.
The name "rainbow squares" refers to the use of this problem in the elementary school classroom where children draw colored connecting "rainbows" to make the pairings.
Number of perfect matchings in the graph with vertices 1 to 2n and edges {i,j} where i+j is a square.  Robert Israel, Mar 22 2015


LINKS

Gordon Hamilton, Kiran S. Kedlaya, and Henri Picciotto, SquareSum Pair Partitions, The College Mathematics Journal, Vol. 46, No. 4 (September 2015), pp. 264269.


EXAMPLE

One of the solutions for n=13 consists of the following pairings of 126:
{1,15}, adding to 16;
{2,23}, {3,22}, {4,21}, {5,20}, {6,19}, {7,18}, {8,17}, {9,16}, {11,14}, {12, 13}, each adding to 25;
{10,26}, adding to 36;
{24,25}, adding to 49.
There are five other such pairings possible, so a(13) = 6.


MAPLE

F:= proc(S)
option remember;
local s, ts;
if nops(S) = 0 then return 1 fi;
s:= S[1];
ts:= select(t > issqr(s+t), S minus {s});
add(procname(S minus {s, t}), t = ts);
end proc:


MATHEMATICA

F[S_] := F[S] = Module[{s, ts}, If[Length[S] == 0, Return[1]]; s = S[[1]]; ts = Select[S ~Complement~ {s}, IntegerQ[Sqrt[s + #]]&]; Sum[F[S ~Complement~ {s, t}], {t, ts}]];


CROSSREFS



KEYWORD

nonn,more


AUTHOR



EXTENSIONS



STATUS

approved



