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 A203602 #14 Sep 13 2020 17:00:52 %S A203602 1,3,2,5,7,4,9,11,13,15,17,6,19,21,8,23,25,27,29,31,10,33,35,12,37,39, %T A203602 14,41,43,16,45,47,18,49,51,53,55,57,20,59,61,22,63,65,67,69,71,24,73, %U A203602 75,26,77,79,28,81,83,30,85,87,32,89,91,93,95,97,34,99 %N A203602 Inverse permutation to A092401. %H A203602 Reinhard Zumkeller, <a href="/A203602/b203602.txt">Table of n, a(n) for n = 1..1000</a> %H A203602 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a> %F A203602 a(n) = -2*(Sum_{k=0..-1+floor(log(n)/log(3))} (-1)^k*floor(n/3^(k+1)))*(-1 + (floor(log(3*n)/log(3)) mod 2)+Sum_{k=1..floor(log(n)/log(3))} (-1)^k*(-ceiling(n/3^k) + floor(n/3^k))) + (-1 + 2*Sum_{k=0..floor(log(n)/log(3))} (-1)^k*floor(n/3^k))*((floor(log(3*n)/log(3)) mod 2)+Sum_{k=1..floor(log(n)/log(3))} (-1)^k*(-ceiling(n/3^k) + floor(n/3^k))). - _Daniel Hoying_, Aug 06 2020 %t A203602 div[n_, m_]=Floor[n/m // Chop]-Ceiling[n/m // Chop](*n not divisible by m=>-1, else 0*); ind[m_]:=Sum[(-1)^(n) div[m, 3^n], {n, 1, Floor[Log[m]/Log[3] // FullSimplify]}] + Mod[Floor[Log[3 m]/Log[3] // FullSimplify], 2];(* returns 0 or 1 depending on if we have an 'n' term (=>1) or a '3n' term (=>0) *) f[m_] := (2* Sum[(-1)^(n) Floor[m/(3^(n)) // FullSimplify], {n, 0, Floor[Log[m]/Log[3] // FullSimplify]}] - 1)* ind[m] + (1 - ind[m]) (2* Sum[(-1)^(n) Floor[m/(3^(n + 1)) // FullSimplify], {n, 0, -1 + Floor[Log[m]/Log[3] // FullSimplify]}]); %t A203602 Table[f[k], {k, 1, 50}] (* _Daniel Hoying_, Aug 06 2020 *) %o A203602 (Haskell) %o A203602 import Data.List (elemIndex) %o A203602 import Data.Maybe (mapMaybe) %o A203602 a203602 n = a203602_list !! (n-1) %o A203602 a203602_list = map (+ 1) $ mapMaybe (`elemIndex` a092401_list) [1..] %K A203602 nonn %O A203602 1,2 %A A203602 _Reinhard Zumkeller_, Jan 03 2012