OFFSET
0,3
REFERENCES
N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..1000
Torleiv Kløve, Spheres of Permutations under the Infinity Norm - Permutations with limited displacement, Reports in Informatics, Department of Informatics, University of Bergen, Norway, no. 376, November 2008.
R. Lagrange, Quelques résultats dans la métrique des permutations, Annales Scientifiques de l'École Normale Supérieure, Paris, 79 (1962), 199-241.
Simon Plouffe, Approximations de séries génératrices et quelques conjectures, Dissertation, Université du Québec à Montréal, 1992; arXiv:0911.4975 [math.NT], 2009.
Simon Plouffe, 1031 Generating Functions, Appendix to Thesis, Montreal, 1992
Index entries for linear recurrences with constant coefficients, signature (2,0,2,0,-1).
FORMULA
G.f.: x/(1 - 2*x - 2*x^3 + x^5). - Simon Plouffe
a(n) = Sum_{k=0..n-1} A002524(k). - Sean A. Irvine, Mar 10 2014
MAPLE
A002525:=z/(1-2*z-2*z**3+z**5); # conjectured by Simon Plouffe in his 1992 dissertation
MATHEMATICA
a[n_ /; n <= 2] := n; a[3]=4; a[4]=10; a[n_] := a[n] = 2*a[n-1] + 2*a[n-3] - a[n-5]; Table[a[n], {n, 0, 29}] (* Jean-François Alcover, Mar 12 2014 *)
PROG
(PARI) a(n) = {z = x + x*O(x^n); gf = z/(1-2*z-2*z^3+z^5); polcoeff(gf, n); } \\ Michel Marcus, Mar 11 2014
(Magma) I:=[0, 1, 2, 4, 10]; [n le 5 select I[n] else 2*Self(n-1) +2*Self(n-3) -Self(n-5): n in [1..41]]; // G. C. Greubel, Jan 22 2022
(Sage) [( x/(1-2*x-2*x^3+x^5) ).series(x, n+1).list()[n] for n in (0..40)] # G. C. Greubel, Jan 22 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
EXTENSIONS
More terms from Sean A. Irvine, Mar 10 2014
STATUS
approved