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-9 of 9 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

A071983 Square chains: the number of 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, 1, 0, 0, 0, 0, 0, 3, 0, 10, 12, 35, 52, 19, 20, 349, 392, 669, 4041, 17175, 12960, 14026, 11889, 29123, 39550, 219968, 553694, 2178103, 5301127, 12220138, 38838893, 68361609, 140571720, 280217025, 204853870, 738704986, 2368147377, 5511090791, 9802605881, 21164463050, 47746712739, 68092497615, 123092214818
Offset: 15

Views

Author

William Rex Marshall, Jun 16 2002

Keywords

Comments

For n > 31, this sequence counts each circular solution (in which the first and last numbers also sum to a square) n times. Sequence A090460 counts the circular solutions only once, giving the number of essentially different solutions.
The existence of cubic chains in answered affirmatively in Puzzle 311. - T. D. Noe, Jun 16 2005

Examples

			There is only one possible square chain of minimum length, which is: (8, 1, 15, 10, 6, 3, 13, 12, 4, 5, 11, 14, 2, 7, 9) so a(15)=1.
		

References

  • Ruemmler, Ronald E., "Square Loops," Journal of Recreational Mathematics 14:2 (1981-82), page 141; Solution by Chris Crandell and Lance Gay, JRM 15:2 (1982-83), page 155.

Crossrefs

Cf. A071984.
Cf. A078107 (n for which there is no solution).

Formula

a(n) = A090460(n) + (n-1)*A071984(n). - Martin Ehrenstein, May 16 2023

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(53)-a(54) from Martin Ehrenstein, May 16 2023
a(55)-a(56) from Zhao Hui Du, Apr 25 2024
a(57)-a(58) 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

A112663 Smallest circular sequence of period 32 such that any two adjacent numbers sum to a square number.

Original entry on oeis.org

1, 8, 28, 21, 4, 32, 17, 19, 30, 6, 3, 13, 12, 24, 25, 11, 5, 31, 18, 7, 29, 20, 16, 9, 27, 22, 14, 2, 23, 26, 10, 15, 1, 8, 28, 21, 4, 32, 17, 19, 30, 6, 3, 13, 12, 24, 25, 11, 5, 31, 18, 7, 29, 20, 16, 9, 27, 22, 14, 2, 23, 26, 10, 15, 1, 8, 28, 21, 4, 32, 17, 19, 30, 6, 3, 13, 12, 24, 25, 11, 5, 31, 18, 7, 29, 20, 16, 9, 27, 22, 14, 2, 23, 26, 10, 15
Offset: 0

Views

Author

Federico Ramondino, Dec 29 2005

Keywords

Comments

The terms of this sequence are given in A071984. An algorithm for computing circular chains of squares is given in A090460. - T. D. Noe, Dec 30 2005

Examples

			1+8=9
8+28=36
28+21=49
...
26+10=36
10+15=25
15+1=16
		

Crossrefs

Cf. A272259 (has terms a(0..31) in row 32).

Programs

  • PARI
    apply( {A112663(n)=my(r=1);foreach(digits(403079653644429064719159, 6)[1..n%32],s,r=(s+2)^2-r); r}, [0..77]) \\ M. F. Hasler, Jun 23 2025

Formula

a(n) = A272259(32, (n-1) mod 32) for all n, where "mod" is the (nonnegative) remainder operator. - M. F. Hasler, Jun 23 2025

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

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

Original entry on oeis.org

1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 3, 4, 4, 0, 0, 4, 5, 2, 8, 7, 47, 72, 135, 283, 158, 164, 1948, 1467, 2998, 20561, 66700, 130236, 153058, 181635, 239386, 343189, 1600832, 5001577, 16859525, 45119463, 66785667, 218923884, 393626778, 665307164, 3111228585, 2156371427
Offset: 0

Views

Author

Keywords

Comments

Square chains (reversals not counted and circles counted once). There is no solution for n=2-13,18-19 (note offset=0). For n=0 and n=1 we have trivial square circles (which are also known as square loops). Square circles seem to appear for all n>30, see A108661. Cf. A090460 for 1-to-n case.

Examples

			n=14: one solution
  {8,1,0,9,7,2,14,11,5,4,12,13,3,6,10};
n=15: three solutions
  {0,9,7,2,14,11,5,4,12,13,3,6,10,15,1,8},
  {5,11,14,2,7,9,0,4,12,13,3,6,10,15,1,8},
  {8,1,0,9,7,2,14,11,5,4,12,13,3,6,10,15};
n=16: four solutions
  {0,16,9,7,2,14,11,5,4,12,13,3,6,10,15,1,8},
  {5,11,14,2,7,9,16,0,4,12,13,3,6,10,15,1,8},
  {8,1,0,16,9,7,2,14,11,5,4,12,13,3,6,10,15},
  {8,1,15,10,6,3,13,12,4,5,11,14,2,7,9,0,16}.
		

Crossrefs

Programs

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

Extensions

a(42)-a(50) from Bert Dobbelaere, Dec 30 2018

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

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

Original entry on oeis.org

6, 3, 3, 72, 226, 358, 309, 391, 547, 813, 3562, 10741, 36633, 94547, 120424, 393670, 676579, 1088429, 5531195, 3294327, 8335128, 27820643, 75288569, 111875702, 264015370, 465407197, 687532936, 1109951444, 3256360099
Offset: 31

Views

Author

Keywords

Examples

			There is no solution for n=0,...,30, (note offset=31). For n=0,1 we have the trivial square circles {0} and {0,1}, which are not included in the sequence.
There are only six possible square loops of the minimum length (n=31 case):
{1,0,4,5,31,18,7,29,20,16,9,27,22,3,13,12,24,25,11,14,2,23,26,10,6,30,19,17,8,28,21,15},
{1,0,4,12,13,3,6,30,19,17,8,28,21,15,10,26,23,2,14,22,27,9,16,20,29,7,18,31,5,11,25,24},
{1,0,4,21,28,8,17,19,30,6,3,13,12,24,25,11,5,31,18,7,29,20,16,9,27,22,14,2,23,26,10,15},
{1,15,10,26,23,2,14,22,27,9,16,20,29,7,18,31,5,11,25,0,4,21,28,8,17,19,30,6,3,13,12,24},
{1,15,21,28,8,17,19,30,6,10,26,23,2,14,11,5,31,18,7,29,20,16,9,27,22,3,13,12,4,0,25,24},
{1,15,21,28,8,17,19,30,6,10,26,23,2,14,11,25,0,4,5,31,18,7,29,20,16,9,27,22,3,13,12,24}.
In the n=32,33 (resp.) cases, there are three square loop solutions:
{1,0,4,32,17,19,30,6,3,13,12,24,25,11,5,31,18,7,29,20,16,9,27,22,14,2,23,26,10,15,21,28,8},
{1,8,28,21,4,32,17,19,30,6,3,13,12,24,25,11,5,31,18,7,29,20,16,0,9,27,22,14,2,23,26,10,15},
{1,8,28,21,15,10,26,23,2,14,22,27,9,16,20,29,7,18,31,5,11,25,0,4,32,17,19,30,6,3,13,12,24},
and
{1,0,4,32,17,19,30,6,3,13,12,24,25,11,5,20,29,7,18,31,33,16,9,27,22,14,2,23,26,10,15,21,28,8},
{1,8,28,21,4,32,17,19,30,6,3,13,12,24,25,11,5,20,29,7,18,31,33,16,0,9,27,22,14,2,23,26,10,15},
{1,8,28,21,15,10,26,23,2,14,22,27,9,16,33,31,18,7,29,20,5,11,25,0,4,32,17,19,30,6,3,13,12,24}
(resp.).
		

Crossrefs

Cf. A108658 = square chains.

Extensions

a(42)-a(47) from Donovan Johnson, Sep 14 2010
a(48)-a(52) from Fausto A. C. Cariboni, Sep 21 2018
a(53)-a(59) from Bert Dobbelaere, Dec 29 2018

A336749 Number of circular arrangements of the first n positive integers such that adjacent terms have absolute difference 1 or 4.

Original entry on oeis.org

1, 0, 1, 1, 1, 3, 2, 3, 6, 5, 10, 12, 14, 25, 27, 40, 57, 68, 104, 133, 177, 255, 324, 454, 617, 811, 1136, 1507, 2042, 2803, 3729, 5109, 6904, 9290, 12692, 17070, 23152, 31430, 42361, 57567, 77842, 105279, 142865, 193040, 261589, 354316, 479189, 649498, 878905
Offset: 5

Views

Author

Ethan Patrick White, Aug 02 2020

Keywords

Comments

Permutations in which adjacent terms sum to a particular value is a property central to the sequences A090460, A071984, A108658, A272259, and A107929.

Crossrefs

See A079977 or A017899 for other sequences counting similar circular arrangements of positive integers.

Programs

  • Mathematica
    CoefficientList[ Series[(1 + x + x^2 + x^3 + x^4 + x^5 + x^6)/(1 + x - x^3 - x^4 - 2*x^5 - 2*x^6 - x^7 - x^8 - x^9), {x, 0, 50}], x] (* Wesley Ivan Hurt, Nov 07 2020 *)

Formula

a(n) = -a(n-1) + a(n-3) + a(n-4) + 2*a(n-5) + 2*a(n-6) + a(n-7) + a(n-8) + a(n-9) for n > 13.
G.f.: x^5*(1 + x + x^2 + x^3 + x^4 + x^5 + x^6)/(1 + x - x^3 - x^4 - 2*x^5 - 2*x^6 - x^7 - x^8 - x^9). - Stefano Spezia, Aug 03 2020
Showing 1-9 of 9 results.