This site is supported by donations to The OEIS Foundation.

Thanks to everyone who made a donation during our annual appeal!
To see the list of donors, or make a donation, see the OEIS Foundation home page.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A229037 Sequence of positive integers where each is chosen to be as small as possible subject to the condition that no three terms a(j), a(j+k), a(j+2k) (for any j and k) form an arithmetic progression. 25

%I

%S 1,1,2,1,1,2,2,4,4,1,1,2,1,1,2,2,4,4,2,4,4,5,5,8,5,5,9,1,1,2,1,1,2,2,

%T 4,4,1,1,2,1,1,2,2,4,4,2,4,4,5,5,8,5,5,9,9,4,4,5,5,10,5,5,10,2,10,13,

%U 11,10,8,11,13,10,12,10,10,12,10,11,14,20,13

%N Sequence of positive integers where each is chosen to be as small as possible subject to the condition that no three terms a(j), a(j+k), a(j+2k) (for any j and k) form an arithmetic progression.

%C This sequence and A235383 and A235265 were winners in the best new sequence contest held at the OEIS Foundation booth at the 2014 AMS/MAA Joint Mathematics Meetings. - _T. D. Noe_, Jan 20 2014

%C See A236246 for indices n such that a(n)=1. - _M. F. Hasler_, Jan 20 2014

%C See A241673 for indices n such that a(n)=2^k. - _Reinhard Zumkeller_, Apr 26 2014

%C The graph (for up to n = 10000) has an eerie similarity (why?) to the distribution of rising smoke particles subjected to a lateral wind, and where the particles emanate from randomly distributed burning areas in a fire in a forest or field. - _Daniel Forgues_, Jan 21 2014

%C The graph (up to n = 100000) appears to have a fractal structure. The dense areas are not random but seem to repeat, approximately doubling in width and height each time. - _Daniel Forgues_, Jan 21 2014

%C a(A241752(n)) = n and a(m) != n for m < A241752(n). - _Reinhard Zumkeller_, Apr 28 2014

%H Giovanni Resta, Alois P. Heinz, and Charles R Greathouse IV, <a href="/A229037/b229037.txt">Table of n, a(n) for n = 1..100000</a> (1..1000 from Resta, 1001..10000 from Heinz, and 10001..100000 from Greathouse)

%H Xan Gregg, <a href="/A229037/a229037_1.png">Enhanced scatterplot of 10000 terms</a> [In this plot, the points have been made translucent to reduce the information lost to overstriking, and the point size varies with n in an attempt to keep the density comparable.]

%H OEIS, <a href="/A229037/a229037.png">Pin plot of 200 terms and scatterplot of 10000 terms</a>

%H <a href="http://oeis.org/wiki/Index_to_OEIS:_Section_Gra#graphs_plots">Index entries for sequences with interesting graphs or plots</a>

%H <a href="http://oeis.org/wiki/Index_to_OEIS:_Section_No#non_averaging">Index entries for non-averaging sequences</a>

%F a(n) <= (n+1)/2. - _Charles R Greathouse IV_, Jan 21 2014

%t a[1] = 1; a[n_] := a[n] = Block[{z = 1}, While[Catch[ Do[If[z == 2*a[n-k] - a[n-2*k], Throw@True], {k, Floor[(n-1)/2]}]; False], z++]; z]; a /@ Range[100] (* _Giovanni Resta_, Jan 01 2014 *)

%o (PARI) step(v)=my(bad=List(),n=#v+1,t); for(d=1,#v\2,t=2*v[n-d]-v[n-2*d]; if(t>0, listput(bad,t))); bad=Set(bad); for(i=1,#bad, if(bad[i]!=i, return(i))); #bad+1

%o first(n)=my(v=List([1])); while(n--, listput(v, step(v))); Vec(v) \\ _Charles R Greathouse IV_, Jan 21 2014

%o (Haskell)

%o import Data.IntMap (empty, (!), insert)

%o a229037 n = a229037_list !! (n-1)

%o a229037_list = f 0 empty where

%o f i m = y : f (i + 1) (insert (i + 1) y m) where

%o y = head [z | z <- [1..],

%o all (\k -> z + m ! (i - k) /= 2 * m ! (i - k `div` 2))

%o [1, 3 .. i - 1]]

%o -- _Reinhard Zumkeller_, Apr 26 2014

%o (Python)

%o A229037_list = []

%o for n in range(10**6):

%o ....i, j, b = 1, 1, set()

%o ....while n-2*i >= 0:

%o ........b.add(2*A229037_list[n-i]-A229037_list[n-2*i])

%o ........i += 1

%o ........while j in b:

%o ............b.remove(j)

%o ............j += 1

%o ....A229037_list.append(j) # _Chai Wah Wu_, Dec 21 2014

%Y Cf. A094870.

%Y A selection of sequences related to "no three-term arithmetic progression": A003002, A003003, A003278, A004793, A005047, A005487, A033157, A065825, A092482, A093678, A093679, A093680, A093681, A093682, A094870, A101884, A101886, A101888, A140577, A185256, A208746, A229037.

%K nonn,easy,nice,look

%O 1,3

%A _Jack W Grahl_, Sep 11 2013

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

Last modified January 17 23:15 EST 2019. Contains 319251 sequences. (Running on oeis4.)