login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A118833 a(1) = 1. a(n) = (|a(n-1) - n| + 1)th positive integer which does not occur earlier in the sequence. 2

%I #13 Mar 14 2017 03:43:07

%S 1,3,2,6,5,7,4,12,11,9,13,10,16,15,8,24,23,21,18,19,20,22,17,31,30,28,

%T 25,29,14,46,45,43,40,36,27,42,37,32,44,38,35,49,48,41,47,33,61,60,58,

%U 55,51,34,72,71,69,66,62,53,57,52,67,59,56,70,64,50,84,83,81,78,74,54

%N a(1) = 1. a(n) = (|a(n-1) - n| + 1)th positive integer which does not occur earlier in the sequence.

%C This sequence is likely a permutation of the integers.

%H Ivan Neretin, <a href="/A118833/b118833.txt">Table of n, a(n) for n = 1..10000</a>

%e The first 8 terms of the sequence are 1,3,2,6,5,7,4,12. |a(8) - 9| + 1 = 4, so a(9) = the 4th positive integer which doesn't occur earlier in the sequence (i.e., the 4th integer in the sequence 8, 9, 10, 11, 13, 14, ...). Therefore a(9) = 11.

%t Fold[Append[#1, Complement[Range[Max[#1] + (d = Abs[#1[[-1]] - #2] + 1)], #1][[d]]] &, {1}, Range[2, 72]] (* _Ivan Neretin_, Mar 13 2017 *)

%Y Cf. A118834.

%K easy,look,nonn

%O 1,2

%A _Leroy Quet_, May 01 2006

%E More terms from _Franklin T. Adams-Watters_, Nov 28 2006

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 7 07:51 EDT 2024. Contains 372300 sequences. (Running on oeis4.)