A269170 a(n) = n OR floor(n/2), where OR is bitwise-OR (A003986).
0, 1, 3, 3, 6, 7, 7, 7, 12, 13, 15, 15, 14, 15, 15, 15, 24, 25, 27, 27, 30, 31, 31, 31, 28, 29, 31, 31, 30, 31, 31, 31, 48, 49, 51, 51, 54, 55, 55, 55, 60, 61, 63, 63, 62, 63, 63, 63, 56, 57, 59, 59, 62, 63, 63, 63, 60, 61, 63, 63, 62, 63, 63, 63, 96, 97, 99, 99, 102, 103, 103, 103, 108, 109, 111, 111, 110, 111
Offset: 0
Links
- Antti Karttunen, Table of n, a(n) for n = 0..8191
Crossrefs
Programs
-
Mathematica
Table[BitOr[n, Quotient[n, 2]], {n, 0, 127}] (* Paolo Xausa, Aug 26 2025 *)
-
PARI
a(n) = bitor(n, n\2); \\ Michel Marcus, Feb 29 2016
-
Python
def A269170(n): return n| n>>1 # Chai Wah Wu, Jun 29 2022
-
Scheme
(define (A269170 n) (A003986bi n (/ (- n (A000035 n)) 2))) ;; Here A003986bi implements dyadic bitwise-OR operation (see A003986).
Comments