|
|
A246160
|
|
Inverse function to the injection A065621.
|
|
5
|
|
|
0, 1, 2, 0, 4, 0, 0, 3, 8, 0, 0, 7, 0, 5, 6, 0, 16, 0, 0, 15, 0, 13, 14, 0, 0, 9, 10, 0, 12, 0, 0, 11, 32, 0, 0, 31, 0, 29, 30, 0, 0, 25, 26, 0, 28, 0, 0, 27, 0, 17, 18, 0, 20, 0, 0, 19, 24, 0, 0, 23, 0, 21, 22, 0, 64, 0, 0, 63, 0, 61, 62, 0, 0, 57, 58, 0, 60, 0, 0, 59, 0, 49, 50, 0, 52
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,3
|
|
COMMENTS
|
Sequence has nonzero values a(n) = k at those points n for which A065621(k) = n and zeros at those positions n which are not present in A065621.
Equally, sequence is obtained when the negative terms of A065620 are replaced with zeros
|
|
LINKS
|
|
|
FORMULA
|
|
|
PROG
|
(Scheme, two 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)*a065620(n)
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|