cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A002525 Number of permutations according to distance.

Original entry on oeis.org

0, 1, 2, 4, 10, 24, 55, 128, 300, 700, 1632, 3809, 8890, 20744, 48406, 112960, 263599, 615120, 1435416, 3349624, 7816528, 18240289, 42564706, 99327052, 231785058, 540883000, 1262179815, 2945365040, 6873169028, 16038912628
Offset: 0

Views

Author

Keywords

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).

Crossrefs

Cf. A002524.

Programs

  • 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
    
  • 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 *)
  • 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
    
  • 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

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

Extensions

More terms from Sean A. Irvine, Mar 10 2014