

A057300


Binary counter with odd/even bit positions swapped; base 4 counter with 1's replaced by 2's and vice versa.


15



0, 2, 1, 3, 8, 10, 9, 11, 4, 6, 5, 7, 12, 14, 13, 15, 32, 34, 33, 35, 40, 42, 41, 43, 36, 38, 37, 39, 44, 46, 45, 47, 16, 18, 17, 19, 24, 26, 25, 27, 20, 22, 21, 23, 28, 30, 29, 31, 48, 50, 49, 51, 56, 58, 57, 59, 52, 54, 53, 55, 60, 62, 61, 63, 128, 130, 129, 131, 136, 138
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

0,2


COMMENTS

A selfinverse permutation of the integers.
It is not true in general that a(2n) = 2a(n) + 5n, a(2n+1) = 2a(n) + 5n + 2 as was originally conjectured.
Counterexamples: a(46) = 29; a(92) = 172; binary(172) = [1, 0, 1, 0, 1, 1, 0, 0], but binary(2*29+5*92) = binary(402) = [1, 1, 0, 0, 1, 0, 0, 1, 0]. a(45) = 30; a(91) = 167; binary(167) = [1, 0, 1, 0, 0, 1, 1, 1], but 2*30+5*91+2=397 and binary(397) = [1, 1, 0, 0, 0, 1, 1, 0, 1]  Lambert Herrgesell (zero815(AT)googlemail.com), Jan 13 2007
a(n) = n if and only if n can be written as 3*Sum[d_i*4^k, 0 <= k < infinity], where d_i is either 0 or 1.  Jon Perry, Oct 06 2012


LINKS

Paul Tek, Table of n, a(n) for n = 0..16383
R. Stephan, Some divideandconquer sequences ...
R. Stephan, Table of generating functions


FORMULA

a(4n+k) = 4a(n) + a(k), 0 <= k <= 3.  Jon Perry, Oct 06 2012


EXAMPLE

a(31) = a(4*7+3) = 4*a(7) + a(3) = 4*11 + 3 = 47.


CROSSREFS

Cf. A057301.
Sequence in context: A078045 A202624 A145490 * A076655 A236438 A101486
Adjacent sequences: A057297 A057298 A057299 * A057301 A057302 A057303


KEYWORD

easy,nonn


AUTHOR

Marc LeBrun, Aug 24 2000


STATUS

approved



