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.

A140263 Permutation of nonnegative integers obtained by interleaving A117967 and A117968.

This page as a plain text file.
%I A140263 #21 Jul 09 2025 04:29:22
%S A140263 0,1,2,5,7,3,6,4,8,17,22,15,21,16,23,11,19,9,18,10,20,14,25,12,24,13,
%T A140263 26,53,67,51,66,52,68,47,64,45,63,46,65,50,70,48,69,49,71,35,58,33,57,
%U A140263 34,59,29,55,27,54,28,56,32,61,30,60,31,62,44,76,42,75,43,77,38,73,36
%N A140263 Permutation of nonnegative integers obtained by interleaving A117967 and A117968.
%H A140263 A. Karttunen, <a href="/A140263/b140263.txt">Table of n, a(n) for n = 0..2186</a>
%H A140263 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>
%F A140263 a(n) = A117967(A001057(n)). (Assuming that the domain of A117967 is the whole Z line.)
%o A140263 (Python)
%o A140263 from sympy import ceiling
%o A140263 from sympy.ntheory.factor_ import digits
%o A140263 def a004488(n): return int("".join([str((3 - i)%3) for i in digits(n, 3)[1:]]), 3)
%o A140263 def a117968(n):
%o A140263     if n==1: return 2
%o A140263     if n%3==0: return 3*a117968(n/3)
%o A140263     elif n%3==1: return 3*a117968((n - 1)/3) + 2
%o A140263     else: return 3*a117968((n + 1)/3) + 1
%o A140263 def a117967(n): return 0 if n==0 else a117968(-n) if n<0 else a004488(a117968(n))
%o A140263 def a001057(n): return -(-1)**n*ceiling(n/2)
%o A140263 def a(n): return a117967(a001057(n)) # _Indranil Ghosh_, Jun 07 2017
%Y A140263 Inverse: A140264. Bisections: A117967 & A117968. a(n) = A140265(n+1)-1.
%Y A140263 Cf. A004488, A117966.
%K A140263 nonn,look,hear
%O A140263 0,3
%A A140263 _Antti Karttunen_, May 19 2008, originally described in a posting at the SeqFan mailing list on Sep 15 2005