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.

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

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

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