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.

A081146 Inverse permutation to A081145.

This page as a plain text file.
%I A081146 #13 Oct 19 2017 03:14:12
%S A081146 1,2,5,3,8,11,4,6,14,17,20,9,23,7,26,12,29,32,35,10,15,38,40,43,18,46,
%T A081146 13,21,49,52,55,58,24,16,61,64,27,67,70,72,19,30,75,77,33,80,22,36,83,
%U A081146 86,89,92,95,25,39,98,101,41,104,28,44,107,110,113,116,47,119,31,122
%N A081146 Inverse permutation to A081145.
%H A081146 Reinhard Zumkeller, <a href="/A081146/b081146.txt">Table of n, a(n) for n = 1..10000</a>
%H A081146 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>
%t A081146 f[s_] := Block[{d = Abs[Rest@s - Most@s], k = 1}, While[ MemberQ[d, Abs[k - Last@s]] || MemberQ[s, k], k++ ]; Append[s, k]]; t = Nest[f, {1}, 130]; Table[ Position[t, n], {n, 70}] // Flatten (* _Robert G. Wilson v_, Jun 09 2006 *)
%t A081146 f[s_] := Block[{k = 1, d = Abs[Most@s - Rest@s], l = Last@s}, While[MemberQ[s, k] || MemberQ[d, Abs[l - k]], k++ ]; Append[s, k]]; t = Nest[f, {1}, 125]; Table[Position[t, n], {n, 71}] // Flatten (* _Robert G. Wilson v_, Jun 13 2006 *)
%o A081146 (Haskell)
%o A081146 import Data.List (elemIndex); import Data.Maybe (fromJust)
%o A081146 a081146 = (+ 1) . fromJust . (`elemIndex` a081145_list)
%o A081146 -- _Reinhard Zumkeller_, Jul 02 2015
%Y A081146 Cf. A081145.
%K A081146 nonn
%O A081146 1,2
%A A081146 _Don Reble_, Mar 08 2003