

A242527


Number of cyclic arrangements (up to direction) of {0,1,...,n1} such that the sum of any two neighbors is a prime.


18



0, 0, 0, 0, 1, 1, 2, 6, 6, 22, 80, 504, 840, 6048, 3888, 37524, 72976, 961776, 661016, 11533030, 7544366, 133552142, 208815294, 5469236592, 6429567323, 153819905698, 182409170334, 4874589558919, 7508950009102, 209534365631599
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

1,7


COMMENTS

a(n)=NPC(n;S;P) is the count of all neighborproperty cycles for a specific set S={0,1,...,n1} of n elements and a specific pairproperty P. For more details, see the link and A242519.
For the same pairproperty P but the set {1 through n}, see A051252. Using for pairproperty the difference, rather than the sum, one obtains A228626.


LINKS

Table of n, a(n) for n=1..30.
S. Sykora, On NeighborProperty Cycles, Stan's Library, Volume V, 2014.


EXAMPLE

The first such cycle is of length n=5: {0,2,1,4,3}.
The first case with 2 solutions is for cucle length n=7:
C_1={0,2,3,4,1,6,5}, C_2={0,2,5,6,1,4,3}.
The first and the last of the 22 such cycles of length n=10 are:
C_1={0,3,2,1,4,9,8,5,6,7}, C_22={0,5,8,9,4,3,2,1,6,7}.


PROG

(C++) See the link.


CROSSREFS

Cf. A051252, A228626, A242519, A242520, A242521, A242522, A242523, A242524, A242525, A242526, A242528, A242529, A242530, A242531, A242532, A242533, A242534.
Sequence in context: A258702 A119551 A100634 * A130865 A282170 A105725
Adjacent sequences: A242524 A242525 A242526 * A242528 A242529 A242530


KEYWORD

nonn,hard


AUTHOR

Stanislav Sykora, May 30 2014


EXTENSIONS

a(23)a(30) from Max Alekseyev, Jul 09 2014


STATUS

approved



