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.

A140264 Inverse permutation to A140263.

This page as a plain text file.
%I A140264 #19 Jul 06 2025 12:39:38
%S A140264 0,1,2,5,7,3,6,4,8,17,19,15,23,25,21,11,13,9,18,16,20,12,10,14,24,22,
%T A140264 26,53,55,51,59,61,57,47,49,45,71,73,69,77,79,75,65,67,63,35,37,33,41,
%U A140264 43,39,29,31,27,54,52,56,48,46,50,60,58,62,36,34,38,30,28,32,42,40,44
%N A140264 Inverse permutation to A140263.
%H A140264 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>
%F A140264 a(n) = A140266(n+1)-1.
%o A140264 (Scheme) (define (A140264 n) (- (A140266 (+ 1 n)) 1))
%o A140264 (Python)
%o A140264 def a117966(n):
%o A140264     if n==0: return 0
%o A140264     if n%3==0: return 3*a117966(n/3)
%o A140264     elif n%3==1: return 3*a117966((n - 1)/3) + 1
%o A140264     else: return 3*a117966((n - 2)/3) - 1
%o A140264 def Z(z): return 2*z if z>0 else 2*abs(z) + 1
%o A140264 def a140266(n): return Z(a117966(n - 1))
%o A140264 def a(n): return a140266(n + 1) - 1 # _Indranil Ghosh_, Jun 07 2017
%Y A140264 Inverse: A140263.
%K A140264 nonn
%O A140264 0,3
%A A140264 _Antti Karttunen_, May 19 2008