A325790 Number of permutations of {1..n} such that every positive integer from 1 to n * (n + 1)/2 is the sum of some circular subsequence.
1, 1, 2, 6, 16, 100, 492, 1764, 8592, 71208, 395520, 1679480, 9313128, 72154030, 420375872, 1625653650
Offset: 0
Examples
The a(1) = 1 through a(4) = 16 permutations: (1) (1,2) (1,2,3) (1,2,3,4) (2,1) (1,3,2) (1,3,2,4) (2,1,3) (1,4,2,3) (2,3,1) (1,4,3,2) (3,1,2) (2,1,4,3) (3,2,1) (2,3,1,4) (2,3,4,1) (2,4,1,3) (3,1,4,2) (3,2,1,4) (3,2,4,1) (3,4,1,2) (4,1,2,3) (4,1,3,2) (4,2,3,1) (4,3,2,1)
Crossrefs
Programs
-
Mathematica
subalt[q_]:=Union[ReplaceList[q,{_,s__,_}:>{s}],DeleteCases[ReplaceList[q,{t___,,u___}:>{u,t}],{}]]; Table[Length[Select[Permutations[Range[n]],Range[n*(n+1)/2]==Union[Total/@subalt[#]]&]],{n,0,5}]
-
PARI
weigh(p)={my(b=0); for(i=1, #p, my(s=0,j=i); for(k=1, #p, s+=p[j]; if(!bittest(b,s), b=bitor(b,1<
Andrew Howroyd, Aug 16 2019
Extensions
a(10)-a(12) from Andrew Howroyd, Aug 18 2019
a(13)-a(15) from Bert Dobbelaere, Nov 01 2020
Comments