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

A229082 Number of circular permutations i_0, i_1, ..., i_n of 0, 1, ..., n such that all the n+1 numbers i_0^2+i_1, i_1^2+i_2, ..., i_{n-1}^2+i_n, i_n^2+i_0 are of the form (p-1)/2 with p an odd prime.

Original entry on oeis.org

1, 1, 1, 0, 2, 3, 7, 11, 9, 5, 41, 82, 254, 2412, 9524, 13925, 85318, 220818, 1662421, 10496784, 20690118, 97200566, 460358077
Offset: 1

Views

Author

Zhi-Wei Sun, Sep 13 2013

Keywords

Comments

Conjecture: a(n) > 0 except for n = 4.
Note that if a circular permutation i_0, i_1, ..., i_n of 0, 1, ..., n with i_0 = 0 meets the requirement then we must have i_n = 1. This can be explained as follows: If i_n > 1, then 3 | i_n since 2*(i_n^2+0)+1 is a prime not divisible by 3, and similarly i_{n-1},...,i_1 are also multiples of 3 since 2*(i_{n-1}^2+i_n)+1, ..., 2*(i_1^2+i_2)+1 are primes not divisible by 3. Therefore, i_n > 1 would lead to a contradiction.

Examples

			a(1) = 1 due to the circular permutation (0,1).
a(2) = 1 due to the circular permutation (0,2,1).
a(3) = 1 due to the circular permutation (0,3,2,1).
a(5) = 2 due to the circular permutations
   (0,3,2,4,5,1) and (0,3,5,4,2,1).
a(6) = 3 due to the circular permutations
   (0,3,6,5,4,2,1), (0,6,3,2,4,5,1), (0,6,3,5,4,2,1).
a(7) = 7 due to the circular permutations
   (0,3,6,5,4,2,7,1), (0,3,6,5,4,7,2,1), (0,6,3,2,4,7,5,1),
   (0,6,3,2,5,4,7,1), (0,6,3,2,7,4,5,1), (0,6,3,5,4,2,7,1),
   (0,6,3,5,4,7,2,1).
a(8) = 11 due to the circular permutations
   (0,3,6,5,8,4,2,7,1), (0,3,6,5,8,4,7,2,1),
   (0,3,6,8,4,2,7,5,1), (0,4,6,8,4,7,2,5,1),
   (0,3,6,8,5,4,2,7,1), (0,3,6,8,5,4,7,2,1),
   (0,6,3,2,4,7,5,8,1), (0,6,3,2,5,8,4,7,1),
   (0,6,3,2,7,4,5,8,1), (0,6,3,5,8,4,2,7,1),
   (0,6,3,5,8,4,7,2,1).
a(9) = 9 due to the circular permutations
   (0,6,3,9,2,4,7,5,8,1), (0,6,3,9,2,5,8,4,7,1),
   (0,6,3,9,2,7,4,5,8,1), (0,6,3,9,5,8,4,2,7,1),
   (0,6,3,9,5,8,4,7,2,1), (0,6,3,9,8,4,2,7,5,1),
   (0,6,3,9,8,4,7,2,5,1), (0,6,3,9,8,5,4,2,7,1),
   (0,6,3,9,8,5,4,7,2,1).
a(20) > 0 due to the circular permutation
  (0,3,12,9,15,18,6,20,19,14,13,4,2,7,16,17,11,10,5,8,1).
		

Crossrefs

Programs

  • Mathematica
    (* A program to compute required circular permutations for n = 7. *)
    p[i_,j_]:=tp[i,j]=PrimeQ[2(i^2+j)+1]
    V[i_]:=Part[Permutations[{1,2,3,4,5,6,7}],i]
    m=0
    Do[Do[If[p[If[j==0,0,Part[V[i],j]],If[j<7,Part[V[i],j+1],0]]==False,Goto[aa]],{j,0,7}];
    m=m+1;Print[m,":"," ",0," ",Part[V[i],1]," ",Part[V[i],2]," ",Part[V[i],3]," ",Part[V[i],4]," ",Part[V[i],5]," ",Part[V[i],6]," ",Part[V[i],7]];Label[aa];Continue,{i,1,7!}]

Extensions

a(10)-a(23) from Alois P. Heinz, Sep 13 2013

A229038 Number of undirected circular permutations i_1, ..., i_n of 1, ..., n such that all the n sums i_1^2+i_2^2, ..., i_{n-1}^2+i_n^2, i_n^2+i_1^2 are among those integers m with the Jacobi symbol (m/(2*n+1)) equal to 1.

Original entry on oeis.org

1, 0, 0, 3, 1, 0, 0, 1, 41, 72
Offset: 1

Views

Author

Zhi-Wei Sun, Sep 11 2013

Keywords

Comments

Conjecture: a(n) > 0 if 2*n+1 is a prime greater than 13.
When p = 2*n+1 > 13 is a prime, the conjecture indicates that there is a numbering a_1, a_2, ..., a_n of all the (p-1)/2 = n quadratic residues modulo p such that all the n adjacent sums a_1+a_2, a_2+a_3, ..., a_{n-1}+a_n, a_n+a_1 are also quadratic residues modulo p.
Zhi-Wei Sun also made the following conjecture:
(1) If p = 2*n+1 > 13 is a prime, then there is a circular permutation a_1, a_2, ..., a_n of all the (p-1)/2 = n quadratic residues modulo p such that all the n adjacent sums a_1+a_2, a_2+a_3, ..., a_{n-1}+a_n, a_n+a_1 are quadratic nonresidues modulo p.
(2) For any prime p = 2*n+1 > 5, there is a circular permutation a_1, a_2, ..., a_n of all the (p-1)/2 = n quadratic residues modulo p such that all the n adjacent differences a_1-a_2, a_2-a_3, ..., a_{n-1}-a_n, a_n-a_1 are quadratic residues (or quadratic nonresidues) modulo p.
Noga Alon has confirmed this conjecture.
See also A229878 for a stronger conjecture which remains open.

Examples

			a(4) = 3 due to the circular permutations
         (1,2,3,4), (1,2,4,3), (1,3,2,4).
a(5) = 1 due to the circular permutation (1,2,4,3,5).
a(8) = 1 due to the circular permutation (1,5,8,6,4,3,2,7).
a(9) > 0 due to the circular permutation (1,2,4,3,8,6,5,7,9).
a(10) > 0 due to the circular permutation
         (1, 2, 4, 3, 7, 9, 5, 10, 8, 6).
a(11) > 0 due to the circular permutation
         (1, 5, 2, 3, 4, 10, 8, 11, 7, 6, 9).
a(12) > 0 due to the circular permutation
         (1, 10, 2, 3, 8, 7, 12, 5, 11, 6, 4, 9).
		

Crossrefs

Programs

  • Mathematica
    (* A program to compute required circular permutations for n = 9. To get "undirected" circular permutations, we should identify a circular permutation with the one of the opposite direction; for example, the circular permutation (1,9,7,5,6,8,3,4,2) is identical to (1,2,4,3,8,6,5,7,9) if we ignore direction. Thus a(9) is half of the number of circular permutations yielded by this program. *)
    f[i_,j_,n_]:=JacobiSymbol[i^2+j^2,n]==1
    V[i_]:=Part[Permutations[{2,3,4,5,6,7,8,9}],i]
    m=0
    Do[Do[If[f[If[j==0,1,Part[V[i],j]],If[j<8,Part[V[i],j+1],1],19]==False,Goto[aa]],{j,0,8}];
    m=m+1;Print[m,":"," ",1," ",Part[V[i],1]," ",Part[V[i],2]," ",Part[V[i],3]," ",Part[V[i],4]," ",Part[V[i],5]," ",Part[V[i],6]," ",Part[V[i],7]," ",Part[V[i],8]];Label[aa];Continue,{i,1,8!}]

A229130 Number of permutations i_0, i_1, ..., i_n of 0, 1, ..., n with i_0 = 0 and i_n = n such that the n+1 numbers i_0^2+i_1, i_1^2+i_2, ..., i_{n-1}^2+i_n, i_n^2+i_0 are all relatively prime to both n-1 and n+1.

Original entry on oeis.org

1, 0, 1, 1, 0, 6, 3, 42, 68, 2794, 0, 5311604, 478, 57009, 2716452, 10778632, 207360, 39187872956340, 106144, 26869397610, 11775466120, 22062519153360, 559350576, 29991180449906858400, 257272815600, 12675330087321600, 52248156883498208
Offset: 1

Views

Author

Zhi-Wei Sun, Sep 15 2013

Keywords

Comments

Conjecture: a(n) > 0 except for n = 2, 5, 11. Similarly, for any positive integer n not equal to 4, there is a permutation i_0, i_1, ..., i_n of 0, 1, ..., n with i_0 = 0 and i_n = n such that the n+1 numbers i_0^2-i_1, i_1^2-i_2, ..., i_{n-1}^2-i_n, i_n^2-i_0 are all coprime to both n-1 and n+1.
Zhi-Wei Sun also made the following general conjecture:
For any positive integer k, define E(k) to be the set of those positive integers n for which there is no permutation i_0, i_1, ..., i_n of 0, 1, ..., n with i_0 = 0 and i_n = n such that all the n+1 numbers i_0^k+i_1, i_1^k+i_2, ..., i_{n-1}^k+i_n, i_n^k+i_0 are coprime to both n-1 and n+1. Then E(k) is always finite; in particular, E(1) = {2,4}, E(2) = {2,5,11} and E(3) = {2,4}.

Examples

			a(3) = 1 due to the permutation (i_0,i_1,i_2,i_3)=(0,1,2,3).
a(4) = 1 due to the permutation (0,1,3,2,4).
a(6) = 1 due to the permutations
  (0,1,3,2,5,4,6), (0,1,3,4,2,5,6), (0,2,5,1,3,4,6),
  (0,3,2,4,1,5,6), (0,3,4,1,2,5,6), (0,4,1,3,2,5,6).
a(7) = 3 due to the permutations
  (0,1,6,5,4,3,2,7), (0,5,4,3,2,1,6,7), (0,5,6,1,4,3,2,7).
a(8) > 0 due to the permutation (0,2,1,4,6,5,7,3,8).
a(9) > 0 due to the permutation (0,1,2,3,4,5,6,7,8,9).
a(10) > 0 due to the permutation (0,1,3,5,4,7,9,8,6,2,10).
a(11) = 0 since 6 is the unique i among 0,...,11 with i^2+5 coprime to 11^2-1, and it is also the unique j among 1,...,10 with j^2+11 coprime to 11^2-1.
		

Crossrefs

Programs

  • Mathematica
    (* A program to compute required permutations for n = 8. *)
    V[i_]:=Part[Permutations[{1,2,3,4,5,6,7}],i]
    m=0
    Do[Do[If[GCD[If[j==0,0,Part[V[i],j]]^2+If[j<7,Part[V[i],j+1],8], 8^2-1]>1,Goto[aa]],{j,0,7}];
    m=m+1;Print[m,":"," ",0," ",Part[V[i],1]," ",Part[V[i],2]," ",Part[V[i],3]," ",Part[V[i],4]," ",Part[V[i],5]," ",Part[V[i],6]," ",Part[V[i],7]," ",8];Label[aa];Continue,{i,1,7!}]

Extensions

a(12)-a(17) from Alois P. Heinz, Sep 15 2013
a(19) and a(23) from Alois P. Heinz, Sep 16 2013
a(18), a(20)-a(22) and a(24)-a(27) from Bert Dobbelaere, Feb 18 2020

A229141 Number of circular permutations i_1, ..., i_n of 1, ..., n such that all the n sums i_1^2+i_2, ..., i_{n-1}^2+i_n, i_n^2+i_1 are among those integers m with the Jacobi symbol (m/(2n+1)) equal to 1.

Original entry on oeis.org

1, 0, 0, 2, 0, 1, 0, 5, 35, 0
Offset: 1

Views

Author

Zhi-Wei Sun, Sep 15 2013

Keywords

Comments

Conjecture: a(n) > 0 if 2*n+1 is a prime greater than 11.
Zhi-Wei Sun also made the following conjectures:
(1) For any prime p = 2*n+1 > 11, there is a circular permutation i_1, ..., i_n of 1, ..., n such that all the n numbers i_1^2-i_2, i_2^2-i_3, ..., i_{n-1}^2-i_n, i_n^2-i_1 are quadratic residues modulo p.
(2) Let p = 2*n+1 be an odd prime. If p > 13 (resp., p > 11), then there is a circular permutation i_1, ..., i_n of 1, ..., n such that all the n numbers i_1^2+i_2, i_2^2+i_3, ..., i_{n-1}^2+i_n, i_n^2+i_1 (resp., the n numbers i_1^2-i_2, i_2^2-i_3, ..., i_{n-1}^2-i_n, i_n^2-i_1) are primitive roots modulo p.
(3) Let p = 2*n+1 be an odd prime. If p > 19 (resp. p > 13), then there is a circular permutation i_1, ..., i_n of 1, ..., n such that all the n numbers i_1^2+i_2^2, i_2^2+i_3^2, ..., i_{n-1}^2+i_n^2, i_n^2+i_1^2 (resp., the n numbers i_1^2-i_2^2, i_2^2-i_3^2, ..., i_{n-1}^2-i_n^2, i_n^2-i_1^2) are primitive roots modulo p.
See also the linked arXiv paper of Sun for more conjectures involving primitive roots modulo primes.

Examples

			a(4) = 2 due to the permutations (1,3,2,4) and (1,4,3,2).
a(6) = 1 due to the permutation (1,3,5,2,6,4).
a(8) = 5 due to the permutations
   (1,3,4,2,5,8,6,7), (1,8,3,6,2,4,5,7), (1,8,3,6,7,4,2,5),
   (1,8,3,7,6,2,4,5), (1,8,6,7,3,4,2,5).
a(9) > 0 due to the permutation (1,3,7,6,8,4,9,2,5).
		

Crossrefs

Programs

  • Mathematica
    (* A program to compute the desired circular permutations for n = 8. *)
    f[i_,j_,p_]:=f[i,j,p]=JacobiSymbol[i^2+j,p]==1
    V[i_]:=Part[Permutations[{2,3,4,5,6,7,8}],i]
    m=0
    Do[Do[If[f[If[j==0,1,Part[V[i],j]],If[j<7,Part[V[i],j+1],1],17]==False,Goto[aa]],{j,0,7}];
    m=m+1;Print[m,":"," ",1," ",Part[V[i],1]," ",Part[V[i],2]," ",Part[V[i],3]," ",Part[V[i],4]," ",Part[V[i],5]," ",Part[V[i],6]," ",Part[V[i],7]];Label[aa];Continue,{i,1,7!}]

Extensions

a(10) = 0 from R. J. Mathar, Sep 15 2013

A229543 Number of undirected circular permutations i_0, i_1, ..., i_n of 0, 1, ..., n such that all the n+1 adjacent distances |i_0-i_1|, |i_1-i_2|, ..., |i_{n-1}-i_n|, |i_n-i_0| are perfect squares.

Original entry on oeis.org

1, 0, 0, 1, 0, 1, 1, 1, 9, 14, 32, 184, 123, 696, 935, 6554, 21105, 60756, 241780, 517970, 1835109, 5741024, 16091004, 63590090, 285113492, 1098219807
Offset: 1

Views

Author

Zhi-Wei Sun, Sep 25 2013

Keywords

Comments

Theorem: For any integer n > 5, there is a circular permutation i_0, i_1, ..., i_n of 0, 1, ..., n with both 1 and 4 adjacent to 0 such that all the n+1 adjacent distances |i_0-i_1|, |i_1-i_2|, ..., |i_{n-1}-i_n|, |i_n-i_0| are perfect squares.
Proof: By examples, the result holds for n = 6, ..., 11. Below we assume n > 11 and exhibit a circular permutation meeting the requirement.
If n == 0 (mod 6), then we may take the circular permutation (n,n-4,n-5,n-6,n-10,n-11,n-12,...,8,7,6,2,3,4,0,1,5,9,10,11,...,n-9,n-8,n-7,n-3,n-2,n-1).
If n == 3 (mod 6), then we may take the circular permutation
(n,n-4,n-5,n-6,n-10,n-11,n-12,...,11,10,9,5,1,0,4,3,2,6,7,8,...,n-9,n-8,n-7,n-3,n-2,n-1).
If n == 1 (mod 6), then we may take the circular permutation
(n,n-4,n-5,n-6,n-10,n-11,n-12,...,9,8,7,3,2,1,0,4,5,6,10,11,12,...,n-9,n-8,n-7,n-3,n-2,n-1).
If n == 4 (mod 6), then we may take the circular permutation (n,n-4,n-5,n-6,n-10,n-11,n-12,...,12,11,10,6,5,4,0,1,2,3,7,8,9,...,n-9,n-8,n-7,n-3,n-2,n-1).
If n == 2 (mod 6), then we may take the circular permutation (n,n-4,n-5,n-6,n-10,n-11,n-12,...,10,9,8,4,0,1,5,6,2,3,7,11,12,13,...,n-9,n-8,n-7,n-3,n-2,n-1).
If n == 5 (mod 6), then we may take the circular permutation
(n,n-4,n-5,n-6,n-10,n-11,n-12,...,13,12,11,7,3,2,6,5,1,0,4,8,9,10,...,n-9,n-8,n-7,n-3,n-2,n-1).
Zhi-Wei Sun also used a similar method to show that for any positive integer n not equal to 2 or 4 there is a circular permutation i_0, i_1, ..., i_n of 0, 1, ..., n such that all the n+1 adjacent distances |i_0-i_1|, |i_1-i_2|, ..., |i_{n-1}-i_n|, |i_n-i_0| are triangular numbers.

Examples

			a(1) = 1 due to the circular permutation (0,1).
a(4) = 1 due to the circular permutation (0,1,2,3,4).
a(6) = 1 due to the circular permutation (0,1,5,6,2,3,4).
a(7) = 1 due to the circular permutation (0,1,2,3,7,6,5,4).
a(8) = 1 due to the circular permutation (0,1,5,6,2,3,7,8,4).
a(9) = 9 due to the circular permutations
  (0,1,2,3,4,5,6,7,8,9), (0,1,2,3,4,8,7,6,5,9),
  (0,1,2,3,7,6,5,4,8,9), (0,1,2,3,7,6,5,9,8,4),
  (0,1,2,6,5,4,3,7,8,9), (0,1,2,6,5,9,8,7,3,4),
  (0,1,5,4,3,2,6,7,8,9), (0,1,5,9,8,7,6,2,3,4),
  (0,4,3,2,1,5,6,7,8,9).
a(10) > 0 due to the permutation (0,1,2,3,7,8,9,10,6,5,4).
a(11) > 0 due to the permutation (0,1,5,9,8,7,11,10,6,2,3,4).
		

Crossrefs

Programs

  • Mathematica
    (* A program to compute required circular permutations for n = 8. To get "undirected" circular permutations, we should identify a circular permutation with the one of the opposite direction. Thus a(8) is half of the number of circular permutations yielded by this program. *)
    SQ[n_]:=SQ[n]=IntegerQ[Sqrt[n]]
    f[i_,j_]:=f[i,j]=SQ[Abs[i-j]]
    V[i_]:=V[i]=Part[Permutations[{1,2,3,4,5,6,7,8}],i]
    m=0
    Do[Do[If[f[If[j==0,0,Part[V[i],j]],If[j<8,Part[V[i],j+1],0]]==False,Goto[aa]],{j,0,8}];m=m+1;Print[m,":"," ",0," ",Part[V[i],1]," ",Part[V[i],2]," ",Part[V[i],3]," ",Part[V[i],4]," ",Part[V[i],5]," ",Part[V[i],6]," ",Part[V[i],7]," ",Part[V[i],8]];Label[aa];Continue,{i,1,8!}]

Extensions

a(10)-a(24) from Alois P. Heinz, Sep 26 2013
a(25)-a(26) from Max Alekseyev, Jan 08 2015
Showing 1-5 of 5 results.