cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A268827 Permutation of nonnegative integers: a(0) = 0, a(n) = A268717(1+A268825(n-1)).

This page as a plain text file.
%I A268827 #15 Apr 28 2021 16:28:03
%S A268827 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,
%T A268827 17,48,16,31,29,20,28,18,22,21,23,102,98,97,99,35,33,96,32,47,45,36,
%U A268827 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
%N A268827 Permutation of nonnegative integers: a(0) = 0, a(n) = A268717(1+A268825(n-1)).
%C A268827 The "fifth shifted power" of permutation A268717.
%H A268827 Antti Karttunen, <a href="/A268827/b268827.txt">Table of n, a(n) for n = 0..8191</a>
%H A268827 Indranil Ghosh, <a href="/A268827/a268827.txt">C program to generate the sequence</a>
%H A268827 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>
%F A268827 a(0) = 0, for n >= 1, a(n) = A268717(1+A268825(n-1)).
%t A268827 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 *)
%o A268827 (Scheme) (define (A268827 n) (if (zero? n) n (A268717 (+ 1 (A268825 (- n 1))))))
%o A268827 (PARI) A003188(n) = bitxor(n, n\2);
%o A268827 A006068(n) = if(n<2, n, {my(m = A006068(n\2)); 2*m + (n%2 + m%2)%2});
%o A268827 A268717(n) = if(n<1, 0, A003188(1 + A006068(n - 1)));
%o A268827 A268823(n) = if(n<2, n, A268717(1 + A268717(1 + A268717(n - 2))));
%o A268827 A268825(n) = if(n<1, 0, A268717(1+A268823(n - 1)));
%o A268827 for(n=0, 100, print1(if(n<1, 0,  A268717(1+A268825(n - 1))),", ")) \\ _Indranil Ghosh_, Apr 03 2017
%o A268827 (Python)
%o A268827 def A003188(n): return n^(n//2)
%o A268827 def A006068(n):
%o A268827     if n<2: return n
%o A268827     else:
%o A268827         m=A006068(n//2)
%o A268827         return 2*m + (n%2 + m%2)%2
%o A268827 def A268717(n): return 0 if n<1 else A003188(1 + A006068(n - 1))
%o A268827 def A268823(n): return A268717(1 + A268717(1 + A268717(n - 2))) if n>1 else n
%o A268827 def A268825(n): return A268717(1 + A268823(n - 1)) if n>0 else 0
%o A268827 def a(n): return A268717(1 + A268825(n - 1)) if n>0 else 0
%o A268827 print([a(n) for n in range(101)]) # _Indranil Ghosh_, Apr 03 2017
%Y A268827 Inverse: A268828.
%Y A268827 Cf. A268717, A268825, A268831.
%Y A268827 Row 5 of array A268820.
%K A268827 nonn
%O A268827 0,3
%A A268827 _Antti Karttunen_, Feb 14 2016