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-6 of 6 results.

A071984 Square loops: the number of circular permutations (reversals not counted as different) of the numbers 1 to n such that the sum of any two consecutive numbers is a square.

Original entry on oeis.org

1, 1, 11, 57, 31, 20, 25, 50, 64, 464, 1062, 4337, 10091, 21931, 69623, 115913, 227893, 457707, 297126, 1051583, 3377189, 7618873, 12476654, 25832098, 55792448, 75126741, 129180538, 357114149, 823402071, 3902161448, 20043267339, 131420398568, 347422743997, 811591067418
Offset: 32

Views

Author

William Rex Marshall, Jun 16 2002

Keywords

Comments

It is unknown whether a circular permutation of the numbers 1 to n exists such that the sum of any two consecutive numbers is a cube.
According to Rivera's Puzzle 311, the smallest n for which a cubic loop exists is 473. - T. D. Noe, Nov 26 2007
From Bert Dobbelaere, Dec 28 2018: (Start)
It is easy to see that no solutions for n <= 30 can exist: for each value of n <= 30 at least one number exists that can only be paired with at most one other number to form a square (e.g., 18 for n=30 can only be paired with 7). No Hamiltonian cycle can exist if the graph contains a vertex of degree less than 2.
For the case n=31, the nonexistence of a Hamiltonian cycle is less trivial but can be shown by hand.
(End)

Examples

			There is only one possible square loop of minimum length, which is (32, 4, 21, 28, 8, 1, 15, 10, 26, 23, 2, 14, 22, 27, 9, 16, 20, 29, 7, 18, 31, 5, 11, 25, 24, 12, 13, 3, 6, 30, 19, 17) so a(32)=1.
		

Crossrefs

Formula

a(n) = (A071983(n) - A090460(n)) / (n-1) for n > 1. - Martin Ehrenstein, May 22 2023

Extensions

a(48)-a(49) from Donovan Johnson, Sep 14 2010
a(50)-a(52) from Giovanni Resta, Nov 11 2012
a(53)-a(54) from Fausto A. C. Cariboni, Sep 19 2018
a(55) from Jud McCranie, Sep 30 2018
a(56) from Jud McCranie, Oct 08 2018
a(57) from Fausto A. C. Cariboni, Oct 24 2018
a(58)-a(61) from Bert Dobbelaere, Dec 28 2018
a(62)-a(63) from Martin Ehrenstein, May 22 2023
a(64) from Zhao Hui Du, Apr 30 2024
a(65) from Zhao Hui Du, May 08 2024

A090460 Number of essentially different permutations of the numbers 1 to n such that the sum of adjacent numbers is a square.

Original entry on oeis.org

1, 1, 1, 0, 0, 0, 0, 0, 3, 0, 10, 12, 35, 52, 19, 20, 349, 361, 637, 3678, 15237, 11875, 13306, 10964, 27223, 37054, 201408, 510152, 1995949, 4867214, 11255174, 35705858, 63029611, 129860749, 258247089, 190294696, 686125836, 2195910738, 5114909395, 9141343219, 19769529758, 44678128099, 63885400119
Offset: 15

Views

Author

T. D. Noe, Dec 01 2003

Keywords

Comments

For n > 31, some solutions are circular; that is, the first and last numbers also sum to a square. Note that A071983 counts each circular solution n times. This sequence counts each circular solution only once. The Mathematica program uses backtracking to find all solutions, which can be printed by removing the comment symbols.

Examples

			See A071983.
		

Crossrefs

Cf. A071983, A071984 (number of circular solutions), A090461 (n for which there is a solution).
Cf. A078107 (n for which there is no solution).
Cf. A272259 (row n gives the smallest circular solution, for each n >= 32).

Programs

  • Mathematica
    SquareQ[n_] := IntegerQ[Sqrt[n]]; try[lev_] := Module[{t, j, circular}, If[lev>n, circular=SquareQ[soln[[1]]+soln[[n]]]; If[(!circular&&soln[[1]]
    				

Formula

a(n) = A071983(n) - (n-1)*A071984(n).

Extensions

a(43)-a(45) from Donovan Johnson, Sep 14 2010
a(46)-a(47) from Jud McCranie, Aug 18 2018
a(48) from Jud McCranie, Sep 17 2018
a(49)-a(52) from Bert Dobbelaere, Dec 30 2018
a(47) corrected by Bert Dobbelaere, Jan 12 2019
a(53)-a(54) from Martin Ehrenstein, May 22 2023
a(55)-a(57) from Zhao Hui Du, Apr 26 2024

A090461 Numbers k for which there exists a permutation of the numbers 1 to k such that the sum of adjacent numbers is a square.

Original entry on oeis.org

15, 16, 17, 23, 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, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89
Offset: 1

Views

Author

T. D. Noe, Dec 01 2003

Keywords

Comments

Conjecture: sequence includes all integers k > 24. See A090460 for the number of essentially different solutions.
It is now known that 25..299 are in the sequence, see the Numberphile 2 link. - Jud McCranie, Jan 11 2018
Every 25 <= k <= 2^20 is in the sequence and (71*25^m-1)/2 is also in the sequence for every m, hence this sequence is infinite, see Mersenneforum link for the proof; we give Hamiltonian cycle for these k values if k >= 32. - Robert Gerbicz, Jan 17 2017
The conjecture has been proved: every k >= 25 is in the sequence, moreover for k >= 32 there is a Hamiltonian cycle; see Mersenneforum topic for a code and deterministic algorithm to find a sequence. - Robert Gerbicz, Jan 21 2018

Examples

			See A071983.
		

Crossrefs

Cf. A071983, A071984 (number of circular solutions), A090460.
Cf. A078107 (k for which there is no solution).

Programs

  • Maple
    F:= proc(n)
    uses GraphTheory;
    local edg, G;
    edg:= select(t -> issqr(t[1]+t[2]),{seq(seq({i,j},i=1..j-1),j=1..n)}) union {seq({i,n+1},i=1..n)};
    G:= Graph(n+1,edg);
    IsHamiltonian(G)
    end proc:
    select(F, [$1..50]); # Robert Israel, Jun 05 2015
  • Mathematica
    Join[{15, 16, 17, 23}, Range[25, 100]] (* Paolo Xausa, May 28 2024 *)

Extensions

a(31)-a(69) from Donovan Johnson, Sep 14 2010

A078107 Numbers k such that it is not possible to arrange the numbers from 1 to k in a chain with adjacent links summing to a square.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 18, 19, 20, 21, 22, 24
Offset: 1

Views

Author

R. K. Guy, Dec 06 2002

Keywords

Comments

It seems certain, on account of the valences of the underlying graph, that necklaces exist for all larger k, but this may not yet have been proved.
The problem originated (for k = 15) with Bernardo Recamán Santos of Colombia. The problem for necklaces is due to Joe Kisenwether.
Ed Pegg Jr and W. Edwin Clark have found necklaces (and hence chains) for k = 32 onwards up to 50 and for several larger numbers.
It has been proven that there are no more terms. See A090461 for details. - Paolo Xausa, May 29 2024

Examples

			E.g., for 15, 16 or 17, use (16-)9-7-2-14-11-5-4-12-13-3-6-10-15-1-8(-17).
		

Crossrefs

A064817 Maximal number of squares among the n-1 numbers p_i + p_{i+1}, 1 <= i <= n-1, where (p_1, ..., p_n) is any permutation of (1, ..., n).

Original entry on oeis.org

0, 0, 1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 15, 16, 16, 17, 18, 19, 20, 22, 22, 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
Offset: 1

Views

Author

N. J. A. Sloane, Oct 23 2001

Keywords

Comments

a(n) < n by definition, but if we counted the sum p_n + p_1, we could get a(n) = n for 32 <= n <= 49 (see A071984). - David Wasserman, Aug 20 2002
Can be formulated as a traveling salesman problem on a complete graph with node set {0, 1, ..., n} and edge cost -1 if i + j is a square, 0 otherwise. - Rob Pratt, Nov 07 2012
a(n) = n - 1 for 25 <= n <= 500, computed by solving corresponding TSP. - Rob Pratt, Nov 07 2012

Examples

			n=8: take 2,7,8,1,3,6,4,5 to get 5 squares: 2+7, 8+1, 1+3, 3+6, 4+5; a(8) = 5.
(1,8,9,7,2,14,11,5,4,12,13,3,6,10) gives 12 squares and no permutation of (1..14) gives more, so a(14)=12.
		

References

  • Bernardo Recamán Santos, Challenging Brainteasers, Sterling, NY, 2000, page 71, shows a(15) = 14 using 9,7,2,14,11,5,4,12,13,3,6,10,15,1,8.

Crossrefs

Programs

  • Mathematica
    a[n_] := Which[n == 1, 0, n > 30, n - 1, True, tour = FindShortestTour[Range[n], DistanceFunction -> Function[{i, j}, If[IntegerQ[Sqrt[i + j]], -1, 0]]] // Last; cnt = 0; Do[If[IntegerQ[Sqrt[tour[[i]] + tour[[i + 1]]]], cnt++], {i, 1, n}]; cnt]; Table[an = a[n]; Print["a(", n, ") = ", an]; an, {n, 1, 69}] (* Jean-François Alcover, Nov 04 2016 *)

Extensions

More terms from Vladeta Jovovic, Oct 23 2001
More terms from John W. Layman and Charles K. Layman (cklayman(AT)juno.com), Nov 07 2001
More terms from David Wasserman, Aug 20 2002
More terms from Rob Pratt, Nov 07 2012

A107929 Smallest list of integers from 1 to n such that sum of any two adjacent terms is a square.

Original entry on oeis.org

8, 1, 15, 10, 6, 3, 13, 12, 4, 5, 11, 14, 2, 7, 9
Offset: 1

Views

Author

Zak Seidov, Jun 11 2005

Keywords

Comments

This "solution" holds also for numbers 0 to n=15: it is sufficient to put zero at the end of the sequence. The same is true for cases n=16 and 17: {8,1,15,10,6,3,13,12,4,5,11,14,2,7,9,16} (add zero at the end or between 9 and 16 which gives two solutions), {16,9,7,2,14,11,5,4,12,13,3,6,10,15,1,8,17} (add zero at the beginning or between 16 and 9 which gives two solutions). Also, for n=23 (next case with 1-to-n solution), we have 4 0-to-n solutions, etc. Cf. A090461 = numbers n such that there is a permutation of the numbers 1 to n such that the sum of adjacent numbers is a square; A090461 = numbers n such that there is a permutation of the numbers 1 to n such that the sum of adjacent numbers is a square.

Examples

			8+1=9, 1+15=16, 15+10=25, 10+6=16, 6+3=9, 3+13=16, 13+12=25, 12+4=16, 4+5=9, 5+11=16, 11+14=25, 14+2=16, 2+7=9, 7+9=16 all 14 sums are squares.
		

Crossrefs

Showing 1-6 of 6 results.