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

A185645 Number of permutations q_1,...,q_n of the first n primes p_1,...,p_n with q_1 = p_1 = 2 and q_n = p_n, and with |q_1-q_2|, |q_2-q_3|, ..., |q_{n-1}-q_n|, and |q_n-q_1| (if n>2) pairwise distinct.

Original entry on oeis.org

1, 1, 1, 1, 3, 5, 10, 33, 153, 1060, 7337, 51434, 440728, 3587067, 28498105, 271208386, 3014400869, 35358507494
Offset: 1

Views

Author

Zhi-Wei Sun, Aug 29 2013

Keywords

Comments

Conjecture: a(n) > 0 for all n > 0. In general, for any n consecutive primes p_k,...,p_{k+n-1}, there always exists a permutation q_k,...,q_{k+n-1} of p_k,...,p_{k+n-1} with q_{k+n-1} = p_{k+n-1} such that the n-1 numbers |q_k-q_{k+1}|, |q_{k+1}-q_{k+2}|,...,|q_{k+n-2}-q_{k+n-1}| are pairwise distinct. (In the case k = 2, this implies that a(n) > 0.)
Clearly there is no permutation a,b,c of 3,5,7 such that the three numbers |a-b|,|b-c|,|c-a| are pairwise distinct. Also, for {a,b} = {7,11}, the three numbers |5-a|,|a-b|,|b-13| cannot be pairwise distinct.
On Aug 31 2013, Zhi-Wei Sun proved the following extension of the general conjecture: Let a_1 < a_2 < ... < a_n be a sequence of n distinct real numbers in ascending order. Then there is a permutation b_1, ..., b_n of a_1, ..., a_n with b_n = a_n such that |b_1-b_2|, |b_2-b_3|, ..., |b_{n-1}-b_n| are pairwise distinct. In fact, when n = 2*k is even we may take (b_1,...,b_n) = (a_k,a_{k+1},a_{k-1},a_{k+2},...,a_2,a_{2k-1},a_1,a_{2k}); when n = 2*k-1 is odd we may take (b_1,...,b_n) = (a_k,a_{k-1},a_{k+1},a_{k-2},a_{k+2},..., a_2,a_{2k-2},a_1,a_{2k-1}).
On Sep 01 2013, Zhi-Wei Sun made the following conjecture: (i) For any n distinct real numbers a_1, a_2, ..., a_n (not necessarily in ascending or descending order), there is a permutation b_1, ..., b_n of a_1, ..., a_n with b_1 = a_1 such that the n-1 distances |b_1-b_2|, |b_2-b_3|, ..., |b_{n-1}-b_n| are pairwise distinct.
(ii) Let a_1, ..., a_n be n distinct elements of a finite additive abelian group G. Suppose that |G| is not divisible by n, or n is even and G is cyclic. Then there exists a permutation b_1, ..., b_n of a_1, ..., a_n with b_1 = a_1 such that the n-1 differences b_{i+1}-b_i (i = 1, ..., n-1) are pairwise distinct.
We believe that part (ii) of the new conjecture holds at least when G is cyclic, and it might also hold when the group G is not abelian.
Note that if g is a primitive root modulo an odd prime p, then for any j = 0,...,p-2 the permutation g^j, g^{j+1},...,g^{j+p-2} of the p-1 nonzero residues modulo p has adjacent differences g^{i+j+1}-g^{i+j} = g^{i+j}*(g-1) (i = 0, ..., p-3) which are pairwise distinct modulo p.

Examples

			a(4) = 1 since (q_1,q_2,q_3,q_4) = (2,5,3,7) is the only suitable permutation.
a(5) = 3 since there are exactly three suitable permutations(q_1,q_2,q_3,q_4,q_5): (2,3,7,5,11), (2,5,7,3,11) and (2,7,3,5,11).
a(6) = 5 since there are exactly five suitable permutations (q_1,q_2,q_3,q_4,q_5,q_6): (2,5,3,11,7,13), (2,5,7,11,3,13), (2,7,5,11,3,13), (2,7,11,5,3,13), (2,11,5,7,3,13).
a(7) = 10, and the ten suitable permutations (q_1,...,q_7) are as follows:
  (2,3,13,5,7,11,17), (2,7,3,13,11,5,17), (2,7,5,11,3,13,17),
  (2,7,11,5,13,3,17), (2,11,3,13,7,5,17), (2,11,7,5,13,3,17),
  (2,11,7,13,3,5,17), (2,11,7,13,5,3,17), (2,13,3,11,7,5,17),
  (2,13,7,11,3,5,17).
		

Crossrefs

Programs

  • Mathematica
    A185645[n_] := Module[{p, c = 0, i = 1, j, q},
       If[n == 2, Return[1],
       p = Permutations[Table[Prime[j], {j, 2, n - 1}]];
       While[i <= Length[p],
        q = Join[{2}, p[[i]], {Prime[n]}]; i++;
        If[Length[Union[Join[Table[Abs[q[[j]] - q[[j + 1]]], {j, 1, n - 1}], {Abs[q[[n]] - q[[1]]]}]]] == n, c++]]; c]];
    Table[A185645[n], {n, 1, 11}]  (* Robert Price, Apr 04 2019 *)

Extensions

Name clarified by Robert Price, Apr 04 2019
a(12)-a(18) from Bert Dobbelaere, Sep 08 2019

A228728 a(1)=1, a(2)=2 and for n > 2, a(n) is the least integer > a(n-1) such that there is a permutation b(1), ..., b(n) of a(1), ..., a(n) with b(1) = a(1) and b(n) = a(n), and with the n numbers |b(1)-b(2)|, |b(2)-b(3)|, ..., |b(n-1)-b(n)|, |b(n)-b(1)| pairwise distinct.

Original entry on oeis.org

1, 2, 4, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 22, 23, 24, 25, 26
Offset: 1

Views

Author

Zhi-Wei Sun, Aug 31 2013

Keywords

Comments

Conjecture: For any n distinct real numbers a_1 < a_2 < ... < a_n, if there is a permutation b_1,b_2,...,b_n of a_1,...,a_n with |b_1-b_2|, |b_2-b_3|, ..., |b_{n-1}-b_n|, |b_n-b_1| pairwise distinct, then there exists a permutation c_1,c_2,...,c_n of a_1,...,a_n with c_1 = a_1 and c_n = a_n such that the n numbers |c_1-c_2|, |c_2-c_3|, ..., |c_{n-1}-c_n|, |c_n-c_1| are pairwise distinct.
This conjecture is somewhat curious but we are unable to find a counterexample.

Examples

			a(3) = 4 since the permutation 1,2,3 does not meet the requirement (since 2-1 = 3-2) but the permutation 1,2,4 is okay as 2-1, 4-2, 4-1 are pairwise distinct.
a(4) = 6 since none of the permutations 1,2,4,5 and 1,4,2,5 meets the requirement (since 5-4 = 2-1 and 5-2 = 4-1), but the permutation 1,4,2,6 is okay as 4-1, 4-2, 6-2, 6-1 are pairwise distinct.
a(5) = 7 due to the permutation 1,6,2,4,7.
a(6) = 8 due to the permutation 1,4,6,2,7,8.
a(7) = 9 due to the permutation 1,4,8,6,7,2,9.
a(8) = 10 due to the permutation 1,7,4,9,8,6,2,10.
a(9) = 11 due to the permutation 1,6,7,9,2,10,4,8,11.
a(10) = 12 due to the permutation 1,6,8,9,2,11,7,10,4,12.
a(11) = 13 due to the permutation 1,12,2,11,4,10,6,9,7,8,13.
a(12) = 14 due to the permutation
     1, 13, 2, 12, 4, 11, 6, 10, 7, 9, 8, 14.
a(13) = 15 due to the permutation
     1, 11, 6, 8, 12, 9, 10, 2, 14, 7, 13, 4, 15.
a(14) = 16 due to the permutation
     1, 12, 9, 8, 10, 15, 2, 11, 7, 13, 6, 14, 4, 16.
a(15) = 17 due to the permutation
     1, 12, 9, 13, 4, 16, 6, 11, 10, 8, 14, 7, 15, 2, 17.
a(16) = 18 or 19 or 20 due to the permutation
     1, 17, 2, 16, 4, 15, 6, 14, 7, 13, 8, 12, 9, 11, 10, 20.
Permutations for n = 13, 14, 15 were produced by Qing-Hu Hou at Nankai Univ. on the author's request.
From _Charlie Neder_, Aug 23 2018: (Start)
a(16) = 18 due to the permutation
     1, 11, 10, 12, 9, 13, 8, 14, 7, 15, 6, 17, 4, 16, 2, 18.
a(17) = 19 due to the permutation
     1, 11, 12, 10, 13, 9, 14, 8, 15, 7, 16, 2, 18, 6, 17, 4, 19.
a(18) = 20 due to
     1, 12, 11, 13, 10, 14, 9, 15, 8, 16, 7, 17, 2, 19, 6, 18, 4, 20. (End)
From _Bert Dobbelaere_, Sep 09 2019: (Start)
a(19) = 22 due to the permutation
     1, 18, 2, 17, 8, 19, 7, 20, 6, 16, 9, 15, 10, 14, 11, 13, 12, 4, 22.
a(20) = 23 due to the permutation
     1, 18, 7, 20, 6, 22, 4, 19, 9, 16, 8, 17, 11, 13, 12, 15, 10, 14, 2, 23.
a(21) = 24 due to the permutation
     1, 19, 10, 20, 7, 18, 4, 16, 9, 17, 11, 15, 12, 14, 13, 8, 23, 6, 22, 2, 24.
a(22) = 25 due to the permutation
     1, 22, 4, 23, 7, 24, 9, 18, 8, 20, 6, 19, 11, 15, 12, 17, 10, 16, 14, 13, 2, 25.
a(23) = 26 due to the permutation
     1, 22, 7, 25, 6, 23, 10, 24, 4, 20, 8, 19, 11, 17, 13, 18, 9, 16, 14, 15, 12, 2, 26. (End)
		

Crossrefs

Programs

  • Mathematica
    A program to find a(16) in terms of the values a(1),...,a(15):
    V[i_]:=V[i]=Part[Permutations[{2,4,6,7,8,9,10,11,12,13,14,15,16,17}],i]
    Do[Do[Do[If[Length[Union[{Abs[1-Part[V[i],1]]},Table[Abs[Part[V[i],j]-If[j<14,Part[V[i],j+1],n]],{j,1,14}]]]<15,Goto[aa]];
    Print[n," "," ",V[i]];Goto[bb];Label[aa];Continue,{i,1,14!}];Continue,{n,18,20}];Label[bb];Break]
    A228728[n_] := Module[{p, i, j, k, b, lim = 100},
      If[n <= 2, A228728[n] = n,
       j = A228728[n - 1] + 1;
        While[j < lim, A228728[n] = j;
        p = Permutations[Table[A228728[k], {k, 2, n - 1}]];
        i = 1; While[i <= Length[p],
         b = Join[{A228728[1]}, p[[i]], {A228728[n]}]; i++;
         If[Length[Union[Join[Table[Abs[b[[k]] - b[[k + 1]]], {k, 1, n - 1}], {Abs[b[[n]] - b[[1]]]}]]] == n, Return[j]]]; j++]]]
    Table[A228728[n], {n, 1, 11}]  (* Robert Price, Apr 04 2019 *)

Extensions

a(16)-a(18) from Charlie Neder, Aug 23 2018
Name clarified by Robert Price, Apr 04 2019
a(19)-a(23) from Bert Dobbelaere, Sep 09 2019
Showing 1-2 of 2 results.