OFFSET
0,1
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
MAPLE
with(Bits): seq(Or(n, 5), n = 0..60);
PROG
(Magma) [BitwiseOr(n, 5): n in [0..80]]; // Bruno Berselli, Jul 01 2014
(Python)
def A244587(n): return n|5 # Chai Wah Wu, Jan 18 2023
(PARI) a(n) = bitor(n, 5); \\ Michel Marcus, Jan 19 2023
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Gary Detlefs, Jun 30 2014
EXTENSIONS
Some terms corrected by Bruno Berselli, Jul 01 2014
STATUS
approved