login
A319010
a(0) = 0, a(1) = 1; for n >= 1, a(2*n) = a(2*n-1), a(2*n+1) = 2*(n - a(n)).
1
0, 1, 1, 0, 0, 2, 2, 6, 6, 8, 8, 6, 6, 8, 8, 2, 2, 4, 4, 2, 2, 4, 4, 10, 10, 12, 12, 10, 10, 12, 12, 26, 26, 28, 28, 26, 26, 28, 28, 34, 34, 36, 36, 34, 34, 36, 36, 26, 26, 28, 28, 26, 26, 28, 28, 34, 34, 36, 36, 34, 34, 36, 36, 10, 10, 12, 12, 10, 10, 12, 12, 18, 18, 20, 20, 18, 18, 20, 20
OFFSET
0,6
PROG
(PARI) a = vector(100); print1(0", "); for(k=1, #a, print1 (a[k]=if(k==1, 1, my (n=k\2); if (k%2==0, a[2*n-1], 2*(n-a[n])))", "));
(PARI) a(n) = if(n<=1, n, if(n%2==0, a(n-1), 2*((n-1)/2-a((n-1)/2))));
CROSSREFS
KEYWORD
nonn,easy,look
AUTHOR
Altug Alkan, Sep 07 2018
STATUS
approved