%I #4 Jul 19 2013 14:17:07
%S 1,2,5,3,19,8,4,6,17,15,13,11,9,7,34,30,28,26,32,24,22,10,12,14,16,18,
%T 20,61,57,55,53,51,49,47,45,43,41,59,39,23,114,37,25,27,21,29,31,35,
%U 112,110,33,108,106,104,100,98,96,94,92,90,88,86,84,82,80
%N Smallest m such that A100707(m) = n.
%C If A100707 is a permutation of the natural numbers, then this sequence is its inverse;
%C A227632 and A227633 give record values and where they occur:
%C a(A227633(n)) = A227632(n); A227633(n) = A100707(A227632(n)).
%H Reinhard Zumkeller, <a href="/A227617/b227617.txt">Table of n, a(n) for n = 1..10000</a>
%o b-file
%o (Haskell)
%o import qualified Data.Map as Map (null, insert)
%o import Data.Map (empty, deleteFindMin)
%o a227617 n = a227617_list !! (n-1)
%o a227617_list = f 1 empty $ zip a100707_list [1..] where
%o f i mp (uv:uvs)
%o | Map.null mp = f i (uncurry Map.insert uv mp) uvs
%o | y == i = x : f (i + 1) (uncurry Map.insert uv mp') uvs
%o | otherwise = f i (uncurry Map.insert uv mp) uvs
%o where ((y,x), mp') = deleteFindMin mp
%K nonn
%O 1,2
%A _Reinhard Zumkeller_, Jul 19 2013
|