Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
A244587
a(n) = n OR 5.
5
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,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
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).
Sequence in context: A021646 A231589 A133888 * A111186 A127798 A053671
KEYWORD
nonn,easy
AUTHOR
Gary Detlefs, Jun 30 2014
EXTENSIONS
Some terms corrected by Bruno Berselli, Jul 01 2014
STATUS
approved