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.

A002081 Numbers congruent to {2, 4, 8, 16} (mod 20).

Original entry on oeis.org

2, 4, 8, 16, 22, 24, 28, 36, 42, 44, 48, 56, 62, 64, 68, 76, 82, 84, 88, 96, 102, 104, 108, 116, 122, 124, 128, 136, 142, 144, 148, 156, 162, 164, 168, 176, 182, 184, 188, 196, 202, 204, 208, 216, 222, 224, 228, 236, 242, 244, 248, 256, 262, 264, 268, 276, 282
Offset: 0

Views

Author

Keywords

Comments

First differences are periodic, cf. A000689.

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

Programs

  • Haskell
    a002081 n = a002081_list
    a002081_list = filter ((`elem` [2,4,8,16]) . (`mod` 20)) [1..]
    -- Reinhard Zumkeller, Sep 15 2011
  • Maple
    A002081:=2*(1+2*z**2+2*z**3)/(z**2+1)/(z-1)**2; # conjectured by Simon Plouffe in his 1992 dissertation
  • Mathematica
    Flatten[Table[20n + {2, 4, 8, 16}, {n, 0, 14}]] (* Alonso del Arte, Nov 30 2011 *)
    LinearRecurrence[{2, -2, 2, -1},{2, 4, 8, 16},57] (* Ray Chandler, Aug 25 2015 *)
    Select[Range[300],MemberQ[{2,4,8,16},Mod[#,20]]&] (* Harvey P. Dale, Jul 20 2021 *)
  • PARI
    a(n) = 5*n + [2,-1,-2,1][(n%4)+1] \\ Ralf Stephan, Jun 08 2005
    
  • PARI
    is(n) = n > 0 && setsearch([2,4,8,16], n%20) > 0 \\ Rick L. Shepherd, Aug 17 2016
    

Formula

G.f.: 2*(1+2*x^2+2*x^3)/((1-x)^2*(1+x^2)). - Simon Plouffe
a(n+4) = a(n) + 20 for n > 3. - Reinhard Zumkeller, Sep 15 2011
a(n) = 5*n + (1/2)*(3 + (-1)^n)*(-1)^(n(n+1)/2). - Bruno Berselli, Sep 15 2011
E.g.f.: 2*cos(x) - sin(x) + 5*x*exp(x). - Ilya Gutkovskiy, Aug 17 2016

Extensions

More terms from Larry Reeves (larryr(AT)acm.org), Jul 31 2000