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.

A217562 Even numbers not divisible by 5.

Original entry on oeis.org

2, 4, 6, 8, 12, 14, 16, 18, 22, 24, 26, 28, 32, 34, 36, 38, 42, 44, 46, 48, 52, 54, 56, 58, 62, 64, 66, 68, 72, 74, 76, 78, 82, 84, 86, 88, 92, 94, 96, 98, 102, 104, 106, 108, 112, 114, 116, 118, 122, 124, 126, 128, 132
Offset: 1

Views

Author

Jeremy Gardiner, Oct 06 2012

Keywords

Comments

Numbers ending with 2,4,6,8 in base 10.
No term is divisible by 10 therefore a subsequence of A067251 (Numbers with no trailing zeros in decimal representation).
Union of this sequence with A005408 (The odd numbers) gives A067251.
Union of this sequence with A045572 (Numbers that are odd but not divisible by 5) gives A047201.
The even numbers divisible by 5 are A008592 (Multiples of 10).

Crossrefs

Programs

  • BASIC
    for n=1 to 199
    if n mod 5 <> 0 and n mod 2 <> 1 then print str$(n)+", ";
    next n
    print
    
  • Magma
    I:=[2, 4, 6, 8, 12]; [n le 5 select I[n] else Self(n-1) + Self(n-4) - Self(n-5): n in [1..60]]; // Vincenzo Librandi, Dec 28 2012
    
  • Mathematica
    CoefficientList[Series[2*(1 + x + x^2 + x^3 + x^4)/((1 + x)*(1 + x^2)*(x - 1)^2), {x, 0, 100}], x] (* Vincenzo Librandi, Dec 28 2012 *)
  • PARI
    A217562(n)=(n-1)*5\2+2 \\ M. F. Hasler, Oct 07 2012
    
  • Python
    def A217562(n): return (5*n-1>>1)&-2 # Chai Wah Wu, Apr 21 2025

Formula

a(n) = 2*A047201(n).
G.f.: 2*x*(1+x+x^2+x^3+x^4) / ( (1+x)*(1+x^2)*(x-1)^2 ). - R. J. Mathar, Oct 06 2012
a(n) = 2*(n+floor((n-1)/4)). - Aaron J Grech, Sep 28 2024
E.g.f.: (4 - cos(x) + (5*x - 3)*cosh(x) + sin(x) + (5*x - 2)*sinh(x))/2. - Stefano Spezia, Sep 28 2024