A244587 a(n) = n OR 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
Crossrefs
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