OFFSET
0,3
COMMENTS
Indices of 1's: A007583(n),
indices of 2's: A047849(n+1),
indices of 4's: A039301(n+2),
indices of 5's: A153643(n+3),
indices of 8's: A155701(n+2),
indices of 10's: A153643(n+4)+3^((n+1) mod 2),
indices of 13's: A039301(n+3)+3,
indices of 16's: A039301(n+3)+4,
indices of 17's: 17, 19, 27, 49, 51, 91, 177, 179, 347, 689, 691, 1371, 2737, 2739, 5467, 10929, 10931, 21851, 43697, 43699, 87387, 174769, 174771, 349531, 699057, 699059, 1398107, 2796209, 2796211, 5592411, 11184817, 11184819, 22369627, 44739249, 44739251, 89478491, ...
indices of 18's: A039301(n+3)+6,
n's such that a(n)<3: A005578, except the first term.
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..10000
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 *)
PROG
(Python)
for n in range(99):
print(3*n & n, end=', ')
(PARI) a(n)=bitand(n, 3*n) \\ Charles R Greathouse IV, Feb 05 2013
CROSSREFS
KEYWORD
AUTHOR
Alex Ratushnyak, Jun 13 2012
STATUS
approved