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.
%I A140265 #14 Jul 06 2025 12:39:58 %S A140265 1,2,3,6,8,4,7,5,9,18,23,16,22,17,24,12,20,10,19,11,21,15,26,13,25,14, %T A140265 27,54,68,52,67,53,69,48,65,46,64,47,66,51,71,49,70,50,72,36,59,34,58, %U A140265 35,60,30,56,28,55,29,57,33,62,31,61,32,63,45,77,43,76,44,78,39,74,37 %N A140265 Permutation of natural numbers: a(n) = A140263(n-1)+1. %H A140265 Indranil Ghosh, <a href="/A140265/b140265.txt">Table of n, a(n) for n = 1..6561</a> %H A140265 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a> %o A140265 (Scheme) (define (A140265 n) (+ 1 (A140263 (- n 1)))) %o A140265 (Python) %o A140265 from sympy import ceiling %o A140265 from sympy.ntheory.factor_ import digits %o A140265 def a004488(n): return int("".join([str((3 - i)%3) for i in digits(n, 3)[1:]]), 3) %o A140265 def a117968(n): %o A140265 if n==1: return 2 %o A140265 if n%3==0: return 3*a117968(n/3) %o A140265 elif n%3==1: return 3*a117968((n - 1)/3) + 2 %o A140265 else: return 3*a117968((n + 1)/3) + 1 %o A140265 def a117967(n): return 0 if n==0 else a117968(-n) if n<0 else a004488(a117968(n)) %o A140265 def a001057(n): return -(-1)**n*ceiling(n/2) %o A140265 def a(n): return a117967(a001057(n - 1)) + 1 # _Indranil Ghosh_, Jun 07 2017 %Y A140265 Inverse: A140266. %K A140265 nonn,look %O A140265 1,2 %A A140265 _Antti Karttunen_, May 19 2008