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.

A244587 a(n) = n OR 5.

Original entry on oeis.org

5, 5, 7, 7, 5, 5, 7, 7, 13, 13, 15, 15, 13, 13, 15, 15, 21, 21, 23, 23, 21, 21, 23, 23, 29, 29, 31, 31, 29, 29, 31, 31, 37, 37, 39, 39, 37, 37, 39, 39, 45, 45, 47, 47, 45, 45, 47, 47, 53, 53, 55, 55, 53, 53, 55, 55, 61, 61, 63, 63, 61, 61, 63, 63, 69, 69, 71, 71
Offset: 0

Views

Author

Gary Detlefs, Jun 30 2014

Keywords

Crossrefs

Cf. similar sequences of the type n OR k: A109613 (k=1), A174091 (k=2), A244584 (k=3), A244586 (k=4), this sequence (k=5), A244588 (k=6).

Programs

  • Magma
    [BitwiseOr(n, 5): n in [0..80]]; // Bruno Berselli, Jul 01 2014
    
  • Maple
    with(Bits): seq(Or(n,5), n = 0..60);
  • PARI
    a(n) = bitor(n, 5); \\ Michel Marcus, Jan 19 2023
  • Python
    def A244587(n): return n|5 # Chai Wah Wu, Jan 18 2023
    

Formula

a(n) = (n+5) - (n AND 5).
a(n) = (n XOR 5) + (n AND 5).
a(n) = n +((n+1) mod 2)+4*floor(((n+4) mod 8)/4).
a(n) = (2*n + 4*(-1)^floor(n/4) + (-1)^n + 5)/2. - Bruno Berselli, Jul 01 2014
G.f.: (x^6+x^4-3*x^2+5)/((x+1)*(x^4+1)*(x-1)^2). - Alois P. Heinz, Jul 01 2014

Extensions

Some terms corrected by Bruno Berselli, Jul 01 2014