OFFSET
0,3
COMMENTS
The "fourth shifted power" of permutation A268717.
LINKS
Antti Karttunen, Table of n, a(n) for n = 0..8191
Indranil Ghosh, C program to generate the sequence
MATHEMATICA
A003188[n_]:=BitXor[n, Floor[n/2]]; A006068[n_]:=If[n<2, n, Block[{m = A006068[Floor[n/2]]}, 2m + Mod[Mod[n, 2] + Mod[m, 2], 2]]]; A268717[n_]:=If[n<1, 0, A003188[ 1 + A006068[n - 1]]]; A268823[n_]:= If[n<2, n, A268717[1 + A268717[1 + A268717[n - 2]]]]; A268825[n_]:=If[n<1, 0, A268717[1 + A268823[n - 1]]]; Table[A268825[n], {n, 0, 100}] (* Indranil Ghosh, Apr 03 2017 *)
PROG
(PARI) A003188(n) = bitxor(n, n\2);
(Python)
def A003188(n): return n^(n//2)
def A006068(n):
if n<2: return n
else:
m=A006068(n//2)
return 2*m + (n%2 + m%2)%2
print([a(n) for n in range(101)]) # Indranil Ghosh, Apr 03 2017
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Feb 14 2016
STATUS
approved