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.

A336351 Number of cyclic arrangements of S = {1,2,...,6n - 3} such that any three neighbors can be reordered in an arithmetic progression.

This page as a plain text file.
%I A336351 #68 Jan 09 2021 02:08:57
%S A336351 1,1,1,1,1,1,1,2,3,4,5,7,9,12,16,22,30,41,55,74,100
%N A336351 Number of cyclic arrangements of S = {1,2,...,6n - 3} such that any three neighbors can be reordered in an arithmetic progression.
%C A336351 Reversals of these circular permutations are not counted as different.
%C A336351 Lemma: In S = {1,2,...,k} with k mod 3 <> 0 these cyclic arrangements are not possible.
%C A336351 It seems that in S = {1,2,...,k} with k == 0 (mod 6) these cyclic arrangements are not possible, hence the definition of the sequence. Computationally, this conjecture is valid for k <= 114.
%C A336351 Lemma: In a cyclic arrangement of S = {1,2,...,k} the absolute difference between any two neighbors is a nonnegative power of 2.
%C A336351 a(2..19) coincide with A290137(0..17). - _Georg Fischer_, Aug 14 2020
%H A336351 Fausto A. C. Cariboni, <a href="/A336351/a336351_5.txt">Complete solutions for a(1)-a(21)</a>
%e A336351 The cycle with n=1 is {1,2,3}.
%e A336351 The cycle with n=2 is {1,3,2,4,6,8,7,9,5}.
%o A336351 (PARI) getval(va, pos, typ) = {my(vr = vecsort([va[pos-2], va[pos-1]])); if (typ==0, return (2*vr[1] - vr[2])); if (typ==1, return ((vr[1]+vr[2])/2)); if (typ==2, return (2*vr[2] - vr[1])); error("typ is wrong");}
%o A336351 okval(val, n) = {if ((val < 0) || (val > n) || (denominator(val) != 1), return (0)); return (1);}
%o A336351 ok3(v3) = my(vs=vecsort(v3)); (vs[3]-vs[2] == vs[2]-vs[1]);
%o A336351 oklast(va, n, val) = ok3([va[n-1], val, va[1]]) && ok3([val, va[1], va[2]]);
%o A336351 a(n) = {my(va = vector(n), vp = vector(n)); va[1] = 1; my(nb = 0); for (k=2, n, va[2] = k; my(end = 0, pos = 3, vp = vector(n)); while (! end, my(val = getval(va, pos, vp[pos])); if (okval(val, n) && ! vecsearch(vecsort(va), val), my(ok = 1); if (pos == n, ok = oklast(va, n, val)); if (ok, va[pos] = val; if (pos == n, nb++; vp[pos]++; , pos++;); , vp[pos]++;);, vp[pos]++;); while((pos>=3) && (vp[pos] == 3) && !end, if (pos == 3, end=1, vp[pos] = 0; va[pos] = 0; pos --);););); nb;}
%o A336351 for (n=1, 10, print1(a(6*n-3)/2, ", ")) \\ _Michel Marcus_, Aug 02 2020
%Y A336351 Cf. A334625.
%K A336351 nonn,more,hard
%O A336351 1,8
%A A336351 _Fausto A. C. Cariboni_, Jul 19 2020
%E A336351 a(21) from _Fausto A. C. Cariboni_, Aug 22 2020