login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A336351 Number of cyclic arrangements of S = {1,2,...,6n - 3} such that any three neighbors can be reordered in an arithmetic progression. 3
1, 1, 1, 1, 1, 1, 1, 2, 3, 4, 5, 7, 9, 12, 16, 22, 30, 41, 55, 74, 100 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,8
COMMENTS
Reversals of these circular permutations are not counted as different.
Lemma: In S = {1,2,...,k} with k mod 3 <> 0 these cyclic arrangements are not possible.
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.
Lemma: In a cyclic arrangement of S = {1,2,...,k} the absolute difference between any two neighbors is a nonnegative power of 2.
a(2..19) coincide with A290137(0..17). - Georg Fischer, Aug 14 2020
LINKS
Fausto A. C. Cariboni, Complete solutions for a(1)-a(21)
EXAMPLE
The cycle with n=1 is {1,2,3}.
The cycle with n=2 is {1,3,2,4,6,8,7,9,5}.
PROG
(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"); }
okval(val, n) = {if ((val < 0) || (val > n) || (denominator(val) != 1), return (0)); return (1); }
ok3(v3) = my(vs=vecsort(v3)); (vs[3]-vs[2] == vs[2]-vs[1]);
oklast(va, n, val) = ok3([va[n-1], val, va[1]]) && ok3([val, va[1], va[2]]);
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; }
for (n=1, 10, print1(a(6*n-3)/2, ", ")) \\ Michel Marcus, Aug 02 2020
CROSSREFS
Cf. A334625.
Sequence in context: A233522 A112639 A290137 * A241818 A214120 A240840
KEYWORD
nonn,more,hard
AUTHOR
EXTENSIONS
a(21) from Fausto A. C. Cariboni, Aug 22 2020
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 28 20:05 EDT 2024. Contains 371254 sequences. (Running on oeis4.)