This site is supported by donations to The OEIS Foundation.



Annual Appeal: Today, Nov 11 2014, is the 4th anniversary of the launch of the new OEIS web site. 70,000 sequences have been added in these four years, all edited by volunteers. Please make a donation (tax deductible in the US) to help keep the OEIS running.

(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A174702 The number of permutations p of {1,...,n} such that |p(i)-p(i+1)| is in {1,2,3,4,5} for all i from 1 to n-1. 12
1, 2, 6, 24, 120, 720, 3600, 15600, 61872, 236388, 901748, 3509106, 13716168, 53327912, 205176192, 780194112, 2937412512, 10991746368, 40961976672, 152144989056 (list; graph; refs; listen; history; text; internal format)



For n>1, a(n)/2 is the number of Hamiltonian paths on the graph with vertex set {1,...,n} where i is adjacent to j iff |i-j| is in {1,2,3,4,5}.


Table of n, a(n) for n=1..20.

W. Edwin Clark, permutations p in S_n such that m <= |p(i)-p(i+1)| <= M for i from 1 to n-1, SeqFan Discussion, Mar 2010.


f:= proc(m, M, n) option remember; local i, l, p, cnt; l:= array ([i$i=1..n]); cnt:=0; p:= proc(t) local d, j, h; if t=n then d:= `if` (t=1, m, abs(l[t]-l[t-1])); if m<=d and d<=M then cnt:= cnt+1 fi else for j from t to n do l[t], l[j]:= l[j], l[t]; d:= `if` (t=1, m, abs(l[t]-l[t-1])); if m<=d and d<=M then p(t+1) fi od; h:= l[t]; for j from t to n-1 do l[j]:= l[j+1] od; l[n]:= h fi end; p(1); cnt end: a:= n-> f(1, 5, n): seq (a(n), n=1..10); # Alois P. Heinz, Mar 27 2010


Cf. A003274, A174700, A174701, A174703, A174704, A174705, A174706, A174707, A174708, A185030, A216837.

Sequence in context: A189853 A189857 A189860 * A173846 A154654 A189862

Adjacent sequences:  A174699 A174700 A174701 * A174703 A174704 A174705




W. Edwin Clark, Mar 27 2010


a(15)-a(20) from R. H. Hardin, May 06 2010



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

Content is available under The OEIS End-User License Agreement .

Last modified December 22 02:03 EST 2014. Contains 252326 sequences.