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!)
A094870 a(1)=1; for n > 1, a(n) is the minimal positive integer t not equal to a(1), ..., a(n-1) such that t - a(n-i) is not equal to a(n-i) - a(n-2i) for all 1 <= i < n/2. 11

%I #33 May 24 2022 02:43:45

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

%T 28,27,29,36,32,31,33,39,38,34,41,30,37,35,44,48,42,40,43,50,46,52,47,

%U 45,54,49,56,58,57,51,61,53,59,63,60,68,64,62,70,55,65,67,73,69,83,76

%N a(1)=1; for n > 1, a(n) is the minimal positive integer t not equal to a(1), ..., a(n-1) such that t - a(n-i) is not equal to a(n-i) - a(n-2i) for all 1 <= i < n/2.

%C 3n/8 <= a(n) < 3n/2 (P. Hegarty).

%C Conjecture: lim_{n->infinity} a(n)/n = 1 (P. Hegarty).

%C The Hegarty paper shows that this is a permutation. - _Franklin T. Adams-Watters_, May 26 2014

%C Graphically, the sequence {a(n)-n} resembles A293862 (see illustration in Links section). - _Rémy Sigrist_, Feb 06 2020

%H Carl R. White, <a href="/A094870/b094870.txt">Table of n, a(n) for n = 1..10000</a>

%H Peter Hegarty, <a href="https://doi.org/10.37236/1792">Permutations avoiding arithmetic patterns</a>, The Electronic Journal of Combinatorics, 11 (2004), #R39.

%H Rémy Sigrist, <a href="/A094870/a094870.png">Scatterplot of (n, a(n)-n) for n = 1..500000</a>

%H <a href="/index/No#non_averaging">Index entries related to non-averaging sequences</a>

%e a(3)=4 because it can't be 1=a(1), 2=a(2) and 3=2*a(3-1)-a(3-2).

%p A:=proc(n) option remember; local t, S, i; S:={$1..1000} minus {seq(A(i),i=1..n-1)}; t:=min(S[]); i:=1; while i<floor((n+1)/2) do if t-A(n-i)=A(n-i)-A(n-2*i) then S:=S minus {t}; t:=min(S[]); i:=1 else i:=i+1 fi od; t end: A(1):=1: seq(A(n), n=1..200);

%t a[n_] := a[n] = Module[{t, S, i}, S = Union[Range[1000] ~Complement~ Array[a, n-1]]; t = Min[S]; i = 1; While[i < Floor[(n+1)/2], If[t-a[n-i] == a[n-i] - a[n-2i], S = S ~Complement~ {t}; t = Min[S]; i = 1, i++]]; t]; a[1] = 1;

%t Table[a[n], {n, 1, 200}] (* _Jean-François Alcover_, Sep 20 2019, from Maple *)

%Y Cf. A095689 (inverse permutation), A229037, A293862.

%K easy,nonn

%O 1,2

%A Alec Mihailovs (alec(AT)mihailovs.com), Jun 16 2004

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 April 25 12:15 EDT 2024. Contains 371969 sequences. (Running on oeis4.)