login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A268827
Permutation of nonnegative integers: a(0) = 0, a(n) = A268717(1+A268825(n-1)).
6
0, 1, 3, 2, 6, 7, 5, 12, 4, 10, 14, 13, 15, 30, 26, 25, 27, 11, 9, 24, 8, 54, 50, 49, 51, 19, 17, 48, 16, 31, 29, 20, 28, 18, 22, 21, 23, 102, 98, 97, 99, 35, 33, 96, 32, 47, 45, 36, 44, 34, 38, 37, 39, 55, 53, 60, 52, 58, 62, 61, 63, 46, 42, 41, 43, 59, 57, 40, 56, 198, 194, 193, 195, 67, 65, 192, 64, 79, 77, 68, 76, 66, 70, 69, 71, 87
OFFSET
0,3
COMMENTS
The "fifth shifted power" of permutation A268717.
FORMULA
a(0) = 0, for n >= 1, a(n) = A268717(1+A268825(n-1)).
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]]]; A268827[n_]:=If[n<1, 0, A268717[1 + A268825[n - 1]]]; Table[A268827[n], {n, 0, 100}] (* Indranil Ghosh, Apr 03 2017 *)
PROG
(Scheme) (define (A268827 n) (if (zero? n) n (A268717 (+ 1 (A268825 (- n 1))))))
(PARI) A003188(n) = bitxor(n, n\2);
A006068(n) = if(n<2, n, {my(m = A006068(n\2)); 2*m + (n%2 + 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)));
for(n=0, 100, print1(if(n<1, 0, A268717(1+A268825(n - 1))), ", ")) \\ Indranil Ghosh, Apr 03 2017
(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
def A268717(n): return 0 if n<1 else A003188(1 + A006068(n - 1))
def A268823(n): return A268717(1 + A268717(1 + A268717(n - 2))) if n>1 else n
def A268825(n): return A268717(1 + A268823(n - 1)) if n>0 else 0
def a(n): return A268717(1 + A268825(n - 1)) if n>0 else 0
print([a(n) for n in range(101)]) # Indranil Ghosh, Apr 03 2017
CROSSREFS
Inverse: A268828.
Row 5 of array A268820.
Sequence in context: A154435 A006042 A100280 * A092745 A074679 A122323
KEYWORD
nonn
AUTHOR
Antti Karttunen, Feb 14 2016
STATUS
approved