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

A272259 Irregular triangle read by rows: Row n >= 32 gives the smallest square loop, i.e., lexicographically earliest circular permutation of length n such that any two adjacent numbers sum to a perfect square.

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, 20, 29, 7, 18, 31, 33, 16, 9, 27, 22, 14, 2, 23, 26, 10, 15, 1, 3, 13, 12, 4, 32, 17, 8, 28, 21, 15, 34, 30, 19, 6, 10, 26, 23, 2, 14, 22, 27, 9, 16, 33, 31, 18, 7, 29, 20, 5, 11, 25, 24
Offset: 32

Views

Author

Martin Renner, Apr 23 2016

Keywords

Comments

T(n) gives the smallest Hamiltonian cycle in the corresponding undirected unweighted graph with n vertices and edges satisfying the square sum condition, so this is also a solution to the Traveling Salesman Problem.
There are no circular solutions for n < 32.
T(32) = A112663(k-1), 1 <= k <= 32.
Row n has length n, and we start with row n = 32.

Examples

			Table starts with
n = 32: 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.
n = 33: 1, 8, 28, 21, 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.
		

Crossrefs

Cf. A071984 (number of solutions), A112663 (row 32 repeated).

Programs

  • Maple
    with(GraphTheory):
    n:=32; # Vertices from 1 to n
    E:={}: # Edges
    for a from 1 to n do
      for b from a+1 to n do
        if type(sqrt(a+b),integer) then E:={op(E),{a,b}}: fi:
      od:
    od:
    G:=Graph(E);
    T||n:=TravelingSalesman(G)[2,1..n];
  • PARI
    A272259(n)={my(N=[[c^2-a | c<-[sqrtint(a)+1..sqrtint(n+a)], c^2 != 2*a] | a<-[1..n]], used=Vec(1,n), path=Vec(1,n)); for(step=2, n, my(t = [k | k<-N[path[step-1]], k > path[step] && !used[k] ]);
      if (t && (stepM. F. Hasler, Jun 24 2025

A115418 Define a k-th-power loop of length m>1 to be a circular permutation of the numbers 1 to m such that the sum of any two consecutive numbers is a perfect k-th-power; these numbers are the lengths of the possible k-th-power loops.

Original entry on oeis.org

2, 32, 473, 9641
Offset: 1

Views

Author

Roberto Tauraso, Jan 22 2006

Keywords

Crossrefs

Showing 1-3 of 3 results.