OFFSET
0,2
COMMENTS
This sequence is a self-inverse permutation of the nonnegative numbers, with fixed points A039004.
We can build an analog of this sequence for any base b > 1 by considering the alternating sum of digits in base b instead of A065359.
This sequence has similarities with A298847.
The scatter plots have an interesting, "fibrous" look. - Antti Karttunen, Jul 21 2018
LINKS
Rémy Sigrist, Table of n, a(n) for n = 0..16384
Rémy Sigrist, Colored scatterplot of the first 2^16 terms (where the color is function of A065359(n))
Rémy Sigrist, C++ program for A302544
EXAMPLE
The first terms, alongside the binary representations of n and of a(n), and A065359(n), are:
n a(n) bin(n) bin(a(n)) A065359(n)
-- ---- ------ --------- ----------
0 0 0 0 0
1 2 1 10 1
2 1 10 1 -1
3 3 11 11 0
4 8 100 1000 1
5 10 101 1010 2
6 6 110 110 0
7 11 111 1011 1
8 4 1000 100 -1
9 9 1001 1001 0
10 5 1010 101 -2
11 7 1011 111 -1
12 12 1100 1100 0
13 14 1101 1110 1
14 13 1110 1101 -1
15 15 1111 1111 0
16 26 10000 11010 1
17 34 10001 100010 2
18 18 10010 10010 0
19 32 10011 100000 1
20 40 10100 101000 2
PROG
(C++) See Links section.
CROSSREFS
KEYWORD
AUTHOR
Rémy Sigrist, Apr 09 2018
STATUS
approved