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.

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

This page as a plain text file.
%I A268823 #22 Mar 11 2024 18:05:25
%S A268823 0,1,3,2,6,5,7,15,13,4,12,27,25,8,24,14,10,9,11,51,49,16,48,22,18,17,
%T A268823 19,26,30,29,31,23,21,28,20,99,97,32,96,38,34,33,35,42,46,45,47,39,37,
%U A268823 44,36,50,54,53,55,63,61,52,60,43,41,56,40,62,58,57,59,195,193,64,192,70,66,65,67,74,78,77,79,71,69,76,68,82,86,85
%N A268823 Permutation of nonnegative integers: a(0) = 0, a(n) = A268717(1 + A268821(n-1)).
%C A268823 The "third shifted power" of permutation A268717.
%H A268823 Antti Karttunen, <a href="/A268823/b268823.txt">Table of n, a(n) for n = 0..8191</a>
%H A268823 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>
%F A268823 a(0), for n >= 1, a(n) = A268717(1 + A268821(n-1)).
%F A268823 a(0) = 0, a(1) = 1, and for n > 1, a(n) = A268717(1 + A268717(1 + A268717(n-2))).
%F A268823 For n >= 3, a(n) = A003188(3+A006068(n-3)). - _Antti Karttunen_, Mar 11 2024
%o A268823 (Scheme) (define (A268823 n) (if (<= n 1) n (A268717 (+ 1 (A268717 (+ 1 (A268717 (- n 2))))))))
%o A268823 (PARI) A003188(n) = bitxor(n, floor(n/2));
%o A268823 A006068(n) = if(n<2, n, {my(m = A006068(floor(n/2))); 2*m + (n%2 + m%2)%2});
%o A268823 A268717(n) = if(n<1, 0, A003188(1 + A006068(n - 1)));
%o A268823 for(n=0, 100, print1(if(n<2, n, A268717(1 + A268717(1 + A268717(n - 2)))),", ")) \\ _Indranil Ghosh_, Mar 31 2017
%o A268823 (Python)
%o A268823 def A003188(n): return n^(n//2)
%o A268823 def A006068(n):
%o A268823     if n<2: return n
%o A268823     else:
%o A268823         m=A006068(n//2)
%o A268823         return 2*m + (n%2 + m%2)%2
%o A268823 def A268717(n): return 0 if n<1 else A003188(1 + A006068(n - 1))
%o A268823 def a(n): return A268717(1 + A268717(1 + A268717(n - 2))) if n>1 else n
%o A268823 print([a(n) for n in range(101)]) # _Indranil Ghosh_, Mar 31 2017
%Y A268823 Inverse: A268824.
%Y A268823 Cf. A003188, A006068, A268717, A268821, A268825, A268676.
%Y A268823 Row 3 of array A268820.
%K A268823 nonn
%O A268823 0,3
%A A268823 _Antti Karttunen_, Feb 14 2016