A213526 a(n) = 3*n AND n, where AND is the bitwise AND operator.
0, 1, 2, 1, 4, 5, 2, 5, 8, 9, 10, 1, 4, 5, 10, 13, 16, 17, 18, 17, 20, 21, 2, 5, 8, 9, 10, 17, 20, 21, 26, 29, 32, 33, 34, 33, 36, 37, 34, 37, 40, 41, 42, 1, 4, 5, 10, 13, 16, 17, 18, 17, 20, 21, 34, 37, 40, 41, 42, 49, 52, 53, 58, 61, 64, 65, 66, 65, 68
Offset: 0
Links
- Alois P. Heinz, Table of n, a(n) for n = 0..10000
Programs
-
Maple
a:= proc(n) local i, k, m, r; k, m, r:= n, 3*n, 0; for i from 0 while (m>0 or k>0) do r:= r +2^i* irem(m, 2, 'm') *irem(k, 2, 'k') od; r end: seq(a(n), n=0..100); # Alois P. Heinz, Jun 22 2012
-
Mathematica
Table[BitAnd[n, 3*n], {n, 0, 68}] (* Arkadiusz Wesolowski, Jun 23 2012 *)
-
PARI
a(n)=bitand(n,3*n) \\ Charles R Greathouse IV, Feb 05 2013
-
Python
for n in range(99): print(3*n & n, end=',')
Comments