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.

Showing 1-2 of 2 results.

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.

Original entry on oeis.org

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, 351090349416
Offset: 0

Views

Author

Gordon Hamilton, Mar 22 2015

Keywords

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

Examples

			One of the solutions for n=13 consists of the following pairings of 1-26:
  {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.
		

Crossrefs

Programs

  • 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:
    seq(F({$1..2*n}), n = 0 .. 24); # Robert Israel, Mar 22 2015
  • 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}]];
    Table[Print[n]; F[Range[2 n]], {n, 0, 24}] (* Jean-François Alcover, Mar 19 2019, after Robert Israel *)

Extensions

a(26)-a(30) from Hiroaki Yamanouchi, Mar 25 2015
a(31) from Alois P. Heinz, Nov 16 2016
a(32)-a(36) from Linus and Joost VandeVondele, Jun 07 2018
a(37)-a(39) from Bert Dobbelaere, Aug 09 2022

A257542 Square-sum pairs: Numbers n such that 0,1, ..., 2n-1 can be partitioned into n pairs, where each pair adds up to a perfect square.

Original entry on oeis.org

1, 4, 5, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75
Offset: 1

Views

Author

Brian Hopkins, Apr 28 2015

Keywords

Comments

Kilkelly uses induction to prove that all integers greater than 20 are in the sequence after using various methods on smaller cases.
The positive integers except 2, 3, and 6.
The positive integers except the strong divisors of 6. - Omar E. Pol, Apr 30 2015

Examples

			For n = 4: (0, 1), (2, 7), (3, 6), (4, 5)
For n = 7: (0, 9), (1, 8), (2, 7), (3, 13), (4, 12), (5, 11), (6, 10)
		

References

  • T. Kilkelly, The ARML Power Contest, American Mathematical Society, 2015, chapter 11.

Crossrefs

Essentially the same as A055495.

Programs

Formula

From Chai Wah Wu, Aug 13 2020: (Start)
a(n) = 2*a(n-1) - a(n-2) for n > 5.
G.f.: x*(-x^4 + x^3 - 2*x^2 + 2*x + 1)/(x - 1)^2. (End)
Showing 1-2 of 2 results.