login
a(0) = 0; for n>=1, a(n)=least nonnegative integer x such that |x-a(n-1)|>=n and x is not a(k) for any k<n.
5

%I #6 Sep 04 2014 16:40:52

%S 0,1,3,6,2,7,13,4,12,21,5,16,28,8,22,37,9,26,44,10,30,51,11,34,58,14,

%T 40,67,15,45,75,17,49,82,18,53,89,19,57,96,20,61,103,23,68,113,24,71,

%U 119,25,76,127,27,80,134,29,85,142,31,90,150,32

%N a(0) = 0; for n>=1, a(n)=least nonnegative integer x such that |x-a(n-1)|>=n and x is not a(k) for any k<n.

%C A permutation of the nonnegative integers.

%H Reinhard Zumkeller, <a href="/A072007/b072007.txt">Table of n, a(n) for n = 0..10000</a>

%H <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>

%o (Haskell)

%o import Data.List (delete)

%o a072007 n = a072007_list !! n

%o a072007_list = 0 : f 1 0 [1..] where

%o f u v ws = g ws where

%o g (x:xs) = if abs (x - v) < u

%o then g xs else x : f (u + 1) x (delete x ws)

%o -- _Reinhard Zumkeller_, Sep 04 2014

%Y Cf. A072008, A072009 (inverse).

%K nonn

%O 0,3

%A _Clark Kimberling_, Jun 07 2002