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.

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

A228626 Number of Hamiltonian cycles in the undirected simple graph G_n with vertices 1,...,n which has an edge connecting vertices i and j if and only if |i-j| is prime.

Original entry on oeis.org

0, 0, 0, 0, 1, 2, 4, 16, 60, 186, 433, 2215, 11788, 76539, 414240, 2202215, 9655287, 69748712, 444195809, 3703859949, 26688275292, 201673532931, 1265944917365, 11801735916539, 92511897525830, 753795624276096, 5237677221537738, 41074291450736424, 280906738160126067
Offset: 1

Views

Author

Zhi-Wei Sun, Aug 28 2013

Keywords

Comments

Conjecture: a(n) > 0 for all n > 4. In other words, for each n = 5,6,... there is a permutation i_1,...,i_n of 1,...,n such that |i_1-i_2|, |i_2-i_3|, ..., |i_{n-1}-i_n| and |i_n-i_1| are all prime.
Note that this conjecture is different from the prime circle problem in A051252 though they look similar.
On August 30 2013, Yong-Gao Chen (from Nanjing Normal University) confirmed the conjecture for n > 12 as follows: If n = 2*k then G_n contains a Hamiltonian cycle (1,3,5,2,7,9,...,2k-5,2k-3,2k,2k-2,2k-4,2k-1,2k-6,2k-8,...,6,4);
if n = 2*k + 1 then G_n contains a Hamiltonian cycle
(1,3,5,2,7,9,...,2k-5,2k,2k-3,2k-1,2k+1,2k-2,2k-4,...,6,4).
We have got Chen's approval to include his proof here.

Examples

			a(5) = 1 since G_5 contains the unique Hamiltonian cycle (1,4,2,5,3).
a(6) = 2 since G_6 contains exactly two Hamiltonian cycles: (1,3,5,2,4,6) and (1,4,2,5,3,6).
a(7) = 4 since G_7 contains exactly four Hamiltonian cycles: (1,3,5,2,7,4,6), (1,3,5,7,2,4,6), (1,4,2,7,5,3,6) and (1,4,7,2,5,3,6).
a(8) = 16 since G_8 contains exactly 16 Hamiltonian cycles: (1,3,5,2,7,4,6,8), (1,3,5,7,2,4,6,8), (1,3,6,4,2,7,5,8), (1,3,6,4,7,2,5,8), (1,3,6,8,5,2,7,4), (1,3,6,8,5,7,2,4), (1,3,8,5,2,7,4,6), (1,3,8,5,7,2,4,6), (1,4,2,7,5,3,6,8), (1,4,2,7,5,3,8,6), (1,4,2,7,5,8,3,6), (1,4,7,2,5,3,6,8), (1,4,7,2,5,3,8,6), (1,4,7,2,5,8,3,6), (1,6,4,2,7,5,3,8), (1,6,4,7,2,5,3,8).
a(9) > 0 since (1,3,5,7,9,2,4,6,8) is a Hamiltonian cycle in G_9.
a(10) > 0 since (1,3,5,2,4,6,9,7,10,8) is a Hamiltonian cycle in G_{10}.
a(11) > 0 since (1,3,5,10,8,11,9,2,7,4,6) is a Hamiltonian cycle in G_{11}.
a(12) > 0 since (1,3,8,10,5,2,7,4,6,11,9,12) is a Hamiltonian cycle in G_{12}.
		

Crossrefs

Programs

  • Mathematica
    Table[Length[FindHamiltonianCycle[Graph[Flatten[Table[If[PrimeQ[Abs[i - j]], i \[UndirectedEdge] j, {}], {i, 1, n}, {j, i + 1, n}]]], Infinity]], {n, 1, 15}] (* Robert Price, Apr 04 2019 *)

Extensions

a(9)-a(17) from Alois P. Heinz, Aug 28 2013
a(18)-a(19) from Stanislav Sykora, May 30 2014
a(20)-a(29) from Max Alekseyev, Jul 04 2014

A228766 Number of undirected circular permutations i_1,...,i_{n-1} of 1,...,n-1 with i_1 + i_2, i_2 + i_3, ..., i_{n-2} + i_{n-1}, i_{n-1} + i_1 pairwise distinct modulo n.

Original entry on oeis.org

0, 1, 1, 1, 1, 12, 21, 74, 309, 1376, 5016, 27198, 138592, 928544, 4735266, 31263708, 206761952, 1677199872, 11111483094
Offset: 3

Views

Author

Zhi-Wei Sun, Sep 03 2013

Keywords

Comments

Conjecture: a(n) > 0 for all n > 3. In general, if a_1,...,a_n are n > 2 distinct elements of a finite additive abelian group G with n odd or |G| not divisible by n, then there exists a circular permutation b_1,...,b_n of a_1,...,a_n such that b_1+b_2, b_2+b_3, ..., b_{n-1}+b_n, b_n+b_1 are pairwise distinct.
Note that if g is a primitive root modulo a prime p > 3 then 1+g, g+g^2, ..., g^{p-3}+g^{p-2}, g^{p-2}+1 are pairwise distinct modulo p. So a(p) > 0 for any prime p > 3.
If n > 2 is odd, then 0+1, 1+2, ..., (n-2)+(n-1), (n-1)+0 are pairwise distinct modulo n, and hence the conjecture holds in the case {a_1,...,a_n} = G = Z/nZ.

Examples

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

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, (1,7,8,5,6,4,3,2) is identitical to (1,2,3,4,6,5,8,7) if we ignore direction. *)
    V[i_]:=Part[Permutations[{2,3,4,5,6,7,8}],i]
    m=0
    Do[If[Length[Union[{Mod[1+Part[V[i],1],9]},Table[Mod[Part[V[i],j]+If[j<7,Part[V[i],j+1],1],9],{j,1,7}]]]<8,Goto[aa]];
    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!}]
  • Sage
    import itertools
    def a(n):
        ans = 0
        for p in itertools.permutations([i for i in range(1, n)]):
            if len(set((p[i]+p[(i+1)%(n-1)])%n for i in range(n-1))) == n-1: ans += 1
        return ans/(2*n-2)  # Robin Visser, Sep 27 2023

Extensions

a(12)-a(19) from Bert Dobbelaere, Sep 08 2019
a(20)-a(21) from Robin Visser, Sep 27 2023

A228762 Number of undirected circular permutations i_1,...,i_{n-1} of 1,...,n-1 with i_1-i_2, ..., i_{n-2}-i_{n-1}, i_{n-1}-i_1 pairwise distinct modulo n.

Original entry on oeis.org

1, 0, 1, 0, 7, 0, 39, 0, 419, 0, 7208, 0, 226512, 0, 7885970, 0, 345718580, 0, 18478915794, 0
Offset: 3

Views

Author

Zhi-Wei Sun, Sep 03 2013

Keywords

Comments

If i_1,...,i_{n-1} is a permutation of 1,...,n-1 with i_1-i_2, ..., i_{n-2}-i_{n-1}, i_{n-1}-i_1 pairwise distinct modulo n, then 0 = (i_1-i_2)+...+(i_{n-1}-i_1) == 1+2+...+(n-1) = n(n-1)/2 (mod n) and hence n is odd. So a(n) = 0 for every n = 4,6,8,...
If g is a primitive root modulo an odd prime p, then 1-g, g-g^2, g^2-g^3, ..., g^{p-3}-g^{p-2},g^{p-2}-1 are pairwise distinct modulo p. Therefore a(p) > 0 for any odd prime p.
Conjecture: a(n) > 0 for any odd number n > 1. In general, if G is an additive abelian group with |G| = n odd and greater than one, then there is a permutation a_1,...,a_{n-1} of all the nonzero elements of G such that a_1-a_2, a_2-a_3, ..., a_{n-2}-a_{n-1}, a_{n-1}-a_1 are pairwise distinct.
For any integer n > 1, the author has showed that there is a permutation i_1, ..., i_n of 1, ..., n such that i_1-i_2, i_2-i_3, ..., i_{n-1}-i_n are pairwise distinct if and only if n is even.

Examples

			a(3) = 1 since the circular permutation (1,2) of 1,2 meets the requirement.
a(5) = 1 due to the circular permutation (1,2,4,3).
a(7) = 7 due to the following circular permutations:
  (1,2,5,4,6,3), (1,2,6,4,3,5), (1,3,2,5,6,4), (1,3,2,6,4,5),
  (1,3,4,2,6,5), (1,4,5,3,2,6), (1,5,4,2,3,6).
a(9) > 0 due to the circular permutation (1,2,5,3,7,6,8,4).
a(15) > 0 due to the circular permutation
  (1,3,14,7,4,11,5,10,9,12,13,2,8,6).
a(21) > 0 due to the circular permutation
  (1,2,11,8,19,15,9,4,10,3,6,13,18,7,5,17,16,20,12,14).
Permutations for n = 15, 21 were produced by Qing-Hu Hou at Nankai Univ. after the author told him the conjecture.
		

Crossrefs

Programs

  • Maple
    A228762 := proc(n)
        local a, pL,p,mset,per,i ;
        a := 0 ;
        pL := combinat[permute](n-2) ;
        for  p in pL do
            mset := {} ;
            per := [1,seq(op(i,p)+1,i=1..nops(p))] ;
            # only directed
            if op(2,per) <= op(-1,per) then
                for i from 1 to nops(per) do
                    if i = nops(per) then
                        mset := mset union { modp(n+op(i,per)-op(1,per),n) } ;
                    else
                        mset := mset union { modp(n+op(i,per)-op(i+1,per),n) } ;
                    end if;
                end do:
                if nops(mset) = n-1 then
                    a := a+1 ;
                end if;
            end if;
        end do:
        return a;
    end proc:
    for n from 3 do
        A228762(n) ;
    end do; # R. J. Mathar, Sep 03 2013
  • Mathematica
    A program to compute required circular permutations of 1,...,7 (beginning with 1). To get undirected circular permutations, we should identify one such a permutation with the one of the opposite direction; for example, (1,3,6,4,5,2) is identical to (1,2,5,4,6,3).
    V[i_]:=Part[Permutations[{2,3,4,5,6}],i]
    m=0
    Do[If[Length[Union[{Mod[1-Part[V[i],1],7]},Table[Mod[Part[V[i],j]-If[j<5,Part[V[i],j+1],1],7],{j,1,5}]]]<6,Goto[aa]];
    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]];Label[aa];Continue,{i,1,5!}]

Extensions

a(9) and a(11) added by R. J. Mathar, Sep 03 2013
a(12)-a(22) from Robin Visser, Aug 26 2023

A187815 Number of permutations q_1, ..., q_7 of the 7 consecutive primes p_n, p_{n+1}, ..., p_{n+6} with q_1 = p_n and q_7 = p_{n+6}, and with |q_1-q_2|, |q_2-q_3|, ..., |q_6-q_7|, |q_7-q_1| pairwise distinct, where p_k denotes the k-th prime.

Original entry on oeis.org

10, 2, 7, 4, 10, 17, 15, 15, 17, 11, 4, 23, 33, 24, 19, 16, 24, 16, 31, 39, 39, 30, 24, 11, 15, 39, 30, 52, 66, 41, 29, 23, 48, 43, 15, 15, 43, 48, 39, 30, 30, 52, 68, 64, 68, 34, 19, 27, 39, 35, 22, 36, 32, 20, 19, 32, 38, 72, 71, 59
Offset: 1

Views

Author

Zhi-Wei Sun, Aug 30 2013

Keywords

Comments

For each k = 3,4,5,6 there are k consecutive primes p_n, p_{n+1}, ..., p_{n+k-1} such that there is no permutation q_1, ..., q_k of p_n, p_{n+1}, ..., p_{n+k-1} with |q_1-q_2|, ..., |q_{k-1}-q_k|, |q_k-q_1| pairwise distinct. Such consecutive primes include (3, 5, 7), (5, 7, 11, 13), (3, 5, 7, 11, 13), and (p_{2209}, p_{2210}, ..., p_{2214}) = (19471, 19477, 19483, 19489, 19501, 19507).
For k > 7 the author once thought that for any k consecutive primes p_n, p_{n+1}, ..., p_{n+k-1} there always exists a permutation q_1, ..., q_k of p_n, p_{n+1}, ..., p_{n+k-1} with |q_1-q_2|, ..., |q_{k-1}-q_k|, |q_k-q_1| pairwise distinct. But this is unlikely to be true as pointed out by Noam D. Elkies.
See also A185645 for a related conjecture.

Examples

			a(2) = 2 since there are exactly two permutations q_1,...,q_7 of 3,5,7,11,13,17,19 meeting the requirement: (q_1,...,q_7) = (3, 7, 17, 11, 13, 5, 19), (3, 11, 13, 7, 17, 5, 19).
		

Crossrefs

Programs

  • Mathematica
    V[n_,i_]:=Part[Permutations[{Prime[n+1],Prime[n+2],Prime[n+3],Prime[n+4],Prime[n+5]}],i]
    Do[m=0;Do[If[Length[Union[{Abs[Part[V[n,i],1]-Prime[n]]},Table[Abs[Part[V[n,i],j]-If[j<5,Part[V[n,i],j+1],Prime[n+6]]],{j,1,5}]]]<6,Goto[aa]];
    m=m+1;Label[aa];Continue,{i,1,5!}];Print[n," ",m];Continue,{n,1,20}]
    A187815[n_] := Module[{p, c = 0, i = 1, j, q},
       p = Permutations[Table[Prime[j], {j, n + 1, n + 5}]];
       While[i <= Length[p],
        q = Join[{Prime[n]}, p[[i]], {Prime[n + 6]}]; i++;
        If[Length[
           Union[Join[
             Table[Abs[q[[j]] - q[[j + 1]]], {j, 1, 6}], {Abs[
               q[[7]] - q[[1]]]}]]] == 7, c++]]; c];
    Table[A187815[n], {n, 1, 60}]  (* Robert Price, Apr 04 2019 *)

A228860 Number of permutations i_1,...,i_n of 1,...,n with i_1 = 1 and i_n = n, and with the n adjacent sums i_1+i_2, i_2+i_3, ..., i_{n-1}+i_n, i_n+i_1 all coprime to n.

Original entry on oeis.org

1, 1, 0, 1, 2, 1, 40, 36, 144, 78, 126336, 176, 14035200, 69480, 779436, 25401600, 465334732800, 1700352, 127064889262080, 1888106496, 1479065243520, 1774752094080, 18353630943019008000, 144127475712, 116009818818379776000, 30959322906758400, 373881853408444416000
Offset: 1

Views

Author

Zhi-Wei Sun, Sep 05 2013

Keywords

Comments

Conjecture: a(n) > 0 except for n = 3.
If n is a power of two, then a(n) > 0 since the identical permutation 1,2,3,...,n meets the requirement. For any prime p > 3, we have a(p) > 0 since the permutation 1,...,(p-1)/2, (p+3)/2,(p+1)/2,(p+5)/2,...,p meets our purpose.
Let G(n) be the undirected simple graph with vertices 1,...,n which has an edge connecting two distinct vertices i and j if and only if i + j is relatively prime to n. Then, for any n > 2, the number a(n) is just the number of those Hamiltonian cycles in G(n) on which the vertices 1 and n are adjacent.
Let m be any integer relatively prime to n, and let i_k be the smallest positive residue of k*m modulo n. Then i_1, i_2, ..., i_n is a permutation of 1, ..., n with the n adjacent differences i_1-i_2, i_2-i_3, ..., i_{n-1}-i_n, i_n-i_1 all coprime to n.
On Sep 06 2013, the author's two former PhD students Hui-Qin Cao (from Nanjing Audit Univ.) and Hao Pan (from Nanjing Univ.) proved the conjecture fully.

Examples

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

Crossrefs

Programs

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

Extensions

a(12)-a(27) from Max Alekseyev, Sep 13 2013

A187011 Determinant of the n X n matrix with (i,j)-entry equal to |p_i-p_j|, where p_k denotes the k-th prime.

Original entry on oeis.org

0, -1, 12, -80, 1152, -5632, 61440, -278528, 2752512, -42467328, 182452224, -2642411520, 23555211264, -99052683264, 869730877440, -11828339933184, 158638912045056, -656820758642688, 8683393080360960, -73742045851680768
Offset: 1

Views

Author

Zhi-Wei Sun, Aug 30 2013

Keywords

Comments

Conjecture: (-1)^(n-1)*a(n) > 0 for all n > 1, and |a(n)|^{1/n} tends to the infinity.

Examples

			a(1) = 0 since p_1 - p_1 = 2 - 2 = 0.
		

Crossrefs

Programs

  • Mathematica
    a[n_]:=Det[Table[Abs[Prime[i]-Prime[j]],{i,1,n},{j,1,n}]]
    Table[a[n],{n,1,20}]

A228772 Number of undirected circular permutations i_0,i_1,...,i_{n-1} of 0,1,...,n-1 such that i_0+i_1+i_2, i_1+i_2+i_3, ..., i_{n-3}+i_{n-2}+i_{n-1}, i_{n-2}+i_{n-1}+i_0, i_{n-1}+i_0+i_1 are pairwise distinct modulo n.

Original entry on oeis.org

0, 3, 2, 24, 24, 392, 513, 4080, 8090, 96816, 238296, 2023896, 7325520, 63277376, 277838352, 2185076682, 12898278126
Offset: 3

Views

Author

Zhi-Wei Sun, Sep 03 2013

Keywords

Comments

Note that if n > 3 is not a multiple of 3 then a(n) > 0 since the natural circular permutation (0,1,2,...,n-1) meets the requirement.
Conjecture: Let G be an additive abelian group. If G is cyclic or G contains no involution, then for any finite subset A of G with |A| = n > 3, there is a numbering a_1,...,a_n of the elements of A such that the n sums a_1+a+2+a_3, a_2+a_3+a_4, ..., a_{n-2}+a_{n-1}+a_n, a_{n-1}+a_n+a_1, a_n+a_1+a_2 are pairwise distinct.
On Sep 13 2013, the author proved the conjecture for any torsion-free abelian group G.

Examples

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

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, (0,4,7,6,5,8,3,2,1) is identical to (0,1,2,3,8,5,6,7,4) if we ignore direction.*)
    V[i_]:=Part[Permutations[{1,2,3,4,5,6,7,8}],i]
    m=0
    Do[If[Length[Union[Table[Mod[If[j==0,0,Part[V[i],j]]+If[j<8,Part[V[i],j+1],0]+If[j<7,Part[V[i],j+2],If[j==7,0,Part[V[i],1]]],9],{j,0,8}]]]<9,Goto[aa]];
    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(18) from Bert Dobbelaere, Sep 08 2019
a(19) from Robin Visser, Sep 24 2023

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