|
|
A246159
|
|
Inverse function to the injection A048724.
|
|
6
|
|
|
0, 0, 0, 1, 0, 3, 2, 0, 0, 7, 6, 0, 4, 0, 0, 5, 0, 15, 14, 0, 12, 0, 0, 13, 8, 0, 0, 9, 0, 11, 10, 0, 0, 31, 30, 0, 28, 0, 0, 29, 24, 0, 0, 25, 0, 27, 26, 0, 16, 0, 0, 17, 0, 19, 18, 0, 0, 23, 22, 0, 20, 0, 0, 21, 0, 63, 62, 0, 60, 0, 0, 61, 56, 0, 0, 57, 0, 59, 58, 0, 48, 0, 0, 49, 0, 51, 50, 0, 0, 55, 54, 0, 52, 0, 0, 53, 32
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,6
|
|
COMMENTS
|
After a(0)=0, sequence has nonzero values a(n) = k at those positions n for which A048724(k) = n and zeros at those positions n which are not present in A048724.
Equally, sequence is obtained when the positive terms of A065620 are replaced with zeros and the sign of the negative terms is reversed.
|
|
LINKS
|
|
|
FORMULA
|
|
|
PROG
|
(Scheme, three different implementations)
(PARI) a065620(n) = if(n<3, n, if(n%2, -2*a065620((n - 1)/2) + 1, 2*a065620(n/2)));
a(n) = -!(hammingweight(n)%2)*a065620(n);
(Python)
def a065620(n): return n if n<3 else 2*a065620(n//2) if n%2==0 else -2*a065620((n - 1)//2) + 1
def a(n): return -(bin(n)[2:].count("1")%2==0)*a065620(n)
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|