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!)
A268306 The number of even permutations p of 1,2,...,n such that -1<=p(i)-i<=2 for i=1,2,...,n 1
1, 1, 2, 4, 7, 12, 22, 41, 75, 137, 252, 464, 853, 1568, 2884, 5305, 9757, 17945, 33006, 60708, 111659, 205372, 377738, 694769, 1277879, 2350385, 4323032, 7951296, 14624713, 26899040, 49475048, 90998801, 167372889, 307846737, 566218426 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,3
LINKS
FORMULA
a(n) = A133872(n)/2 + A000073(n+2)/2.
G.f.: x*(1-x+x^2-x^3-x^5) / ((1-x)*(1+x^2)*(1-x-x^2-x^3)). - Colin Barker, Jan 31 2016
EXAMPLE
There exist two even permutations p of 1,2,3 such that -1<=p(i)-i<=2 for i=1,2,3: (123) and (312), therefore a(3)=2.
MATHEMATICA
CoefficientList[Series[(1 - x + x^2 - x^3 - x^5)/((1 - x) (1 + x^2) (1 - x - x^2 - x^3)), {x, 0, 34}], x] (* Michael De Vlieger, Feb 01 2016 *)
PROG
(Maxima) t1:0$ t2:0$ t3:1$ for i:1 thru 100 do (a:1/2+sin((2*i+1)*%pi/4)/sqrt(2),
t:t1+t2+t3, t1:t2, t2:t3, t3:t, e:(t+a)/2, print(e));
(PARI) Vec(x*(1-x+x^2-x^3-x^5)/((1-x)*(1+x^2)*(1-x-x^2-x^3)) + O(x^50)) \\ Colin Barker, Jan 31 2016
CROSSREFS
Sequence in context: A288317 A064492 A000072 * A018179 A190165 A127542
KEYWORD
easy,nonn
AUTHOR
Dmitry Efimov, Jan 31 2016
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 16:58 EDT 2024. Contains 371254 sequences. (Running on oeis4.)