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.

Showing 1-7 of 7 results.

A101887 Natural numbers excluding A101886.

Original entry on oeis.org

4, 8, 12, 13, 17, 21, 23, 25, 26, 30, 33, 34, 38, 40, 44, 45, 46, 49, 52, 54, 56, 57, 59, 62, 64, 67, 69, 73, 74, 75, 76, 79, 81, 83, 84, 88, 92, 93, 97, 101, 105, 106, 108, 112, 113, 115, 119, 120, 121, 122, 126, 130, 132, 134, 135, 136, 138, 142, 145, 146, 150, 153
Offset: 1

Views

Author

Douglas Stones (dssto1(AT)student.monash.edu.au), Dec 20 2004

Keywords

Crossrefs

A229037 The "forest fire": 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.

Original entry on oeis.org

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, 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, 11, 10, 8, 11, 13, 10, 12, 10, 10, 12, 10, 11, 14, 20, 13
Offset: 1

Views

Author

Jack W Grahl, Sep 11 2013

Keywords

Comments

Added name "forest fire" to make it easier to locate this sequence. - N. J. A. Sloane, Sep 03 2019
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
See A236246 for indices n such that a(n)=1. - M. F. Hasler, Jan 20 2014
See A241673 for indices n such that a(n)=2^k. - Reinhard Zumkeller, Apr 26 2014
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
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
a(A241752(n)) = n and a(m) != n for m < A241752(n). - Reinhard Zumkeller, Apr 28 2014
The indices n such that a(n) = 1 are given by A236313 (relative spacing) up to 19 terms, and A003278 (directly) up to 20 terms. If just placing ones, the 21st 1 would be n=91. The sequence A003278 fails at n=91 because the numbers filling the gaps create an arithmetic progression with a(27)=9, a(59)=5 and a(91)=1. Additionally, if you look at indices n starting at the first instance of 4 or 5, A003278/A236313 provide possible indices for a(n)=4 or a(n)=5, with some indexes instead filled by numbers < (4,5). A003278/A236313 also fail to predict indices for a(n)=4 or a(n)=5 by the ~20th term. - Daniel Putt, Sep 29 2022

Crossrefs

Cf. A094870, A362942 (partial sums).
For a variant see A309890.
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.

Programs

  • Haskell
    import Data.IntMap (empty, (!), insert)
    a229037 n = a229037_list !! (n-1)
    a229037_list = f 0 empty  where
       f i m = y : f (i + 1) (insert (i + 1) y m) where
         y = head [z | z <- [1..],
                       all (\k -> z + m ! (i - k) /= 2 * m ! (i - k `div` 2))
                           [1, 3 .. i - 1]]
    -- Reinhard Zumkeller, Apr 26 2014
    
  • Mathematica
    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 *)
  • 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
    first(n)=my(v=List([1])); while(n--, listput(v, step(v))); Vec(v) \\ Charles R Greathouse IV, Jan 21 2014
    
  • Python
    A229037_list = []
    for n in range(10**6):
        i, j, b = 1, 1, set()
        while n-2*i >= 0:
            b.add(2*A229037_list[n-i]-A229037_list[n-2*i])
            i += 1
            while j in b:
                b.remove(j)
                j += 1
        A229037_list.append(j) # Chai Wah Wu, Dec 21 2014

Formula

a(n) <= (n+1)/2. - Charles R Greathouse IV, Jan 21 2014

A003002 Size of the largest subset of the numbers [1...n] which does not contain a 3-term arithmetic progression.

Original entry on oeis.org

0, 1, 2, 2, 3, 4, 4, 4, 4, 5, 5, 6, 6, 7, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 10, 10, 11, 11, 11, 11, 12, 12, 13, 13, 13, 13, 14, 14, 14, 14, 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 18, 18, 18, 18, 19, 19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 20, 21, 21, 21, 22, 22, 22, 22
Offset: 0

Views

Author

Keywords

Comments

"Sequences containing no 3-term arithmetic progressions" is another phrase people may be searching for.
a(n) = size of largest subset of [1..n] such that no term is the average of any two others. These are also called non-averaging sets, or 3-free sequences. - N. J. A. Sloane, Mar 01 2012
More terms of this sequence can be found directly from A065825, because A003002(n) (this sequence) = the integer k such that A065825(k) <= n < A065825(k+1). - Shreevatsa R, Oct 18 2009

Examples

			Examples from Dybizbanski (2012) (includes earlier examples found by other people):
n, a(n), example of an optimal subset:
0, 0, []
1, 1, [1]
2, 2, [1, 2]
4, 3, [1, 2, 4]
5, 4, [1, 2, 4, 5]
9, 5, [1, 2, 4, 8, 9]
11, 6, [1, 2, 4, 5, 10, 11]
13, 7, [1, 2, 4, 5, 10, 11, 13]
14, 8, [1, 2, 4, 5, 10, 11, 13, 14]
20, 9, [1, 2, 6, 7, 9, 14, 15, 18, 20]
24, 10, [1, 2, 5, 7, 11, 16, 18, 19, 23, 24]
26, 11, [1, 2, 5, 7, 11, 16, 18, 19, 23, 24, 26]
30, 12, [1, 3, 4, 8, 9, 11, 20, 22, 23, 27, 28, 30]
32, 13, [1, 2, 4, 8, 9, 11, 19, 22, 23, 26, 28, 31, 32]
36, 14, [1, 2, 4, 8, 9, 13, 21, 23, 26, 27, 30, 32, 35, 36]
40, 15, [1, 2, 4, 5, 10, 11, 13, 14, 28, 29, 31, 32, 37, 38, 40]
41, 16, [1, 2, 4, 5, 10, 11, 13, 14, 28, 29, 31, 32, 37, 38, 40, 41]
51, 17, [1, 2, 4, 5, 10, 13, 14, 17, 31, 35, 37, 38, 40, 46, 47, 50, 51]
54, 18, [1, 2, 5, 6, 12, 14, 15, 17, 21, 31, 38, 39, 42, 43, 49, 51, 52, 54]
58, 19, [1, 2, 5, 6, 12, 14, 15, 17, 21, 31, 38, 39, 42, 43, 49, 51, 52, 54, 58]
63, 20, [1, 2, 5, 7, 11, 16, 18, 19, 24, 26, 38, 39, 42, 44, 48, 53, 55, 56, 61, 63]
71, 21, [1, 2, 5, 7, 10, 17, 20, 22, 26, 31, 41, 46, 48, 49, 53, 54, 63, 64, 68, 69, 71]
74, 22, [1, 2, 7, 9, 10, 14, 20, 22, 23, 25, 29, 46, 50, 52, 53, 55, 61, 65, 66, 68, 73, 74]
82, 23, [1, 2, 4, 8, 9, 11, 19, 22, 23, 26, 28, 31, 49, 57, 59, 62, 63, 66, 68, 71, 78, 81, 82]
		

References

  • H. L. Abbott, On a conjecture of Erdos and Straus on non-averaging sets of integers, Proc. 5th British Combinatorial Conference, 1975, pp. 1-4.
  • Bloom, T. F. (2014). Quantitative results in arithmetic combinatorics (Doctoral dissertation, University of Bristol).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • E. G. Straus, Nonaveraging sets. In Combinatorics (Proc. Sympos. Pure Math., Vol. XIX, Univ. California, Los Angeles, Calif., 1968), pp. 215-222. Amer. Math. Soc., Providence, R.I., 1971. MR0316255 (47 #4803)
  • T. Tao and V. Vu, Additive Combinatorics, Problem 10.1.3.

Crossrefs

The classical lower bound is A104406; A229037 gives a "greedy" lower bound. - N. J. A. Sloane, Apr 29 2023
Cf. A358062 (diagonal domination number for the n X n queen graph).
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.

Programs

  • Mathematica
    (* Program not suitable to compute a large number of terms *)
    a[n_] := a[n] = For[r = Range[n]; k = n, k >= 1, k--, If[AnyTrue[Subsets[r, {k}], FreeQ[#, {_, a_, _, b_, _, c_, _} /; b - a == c - b] &], Return[k]]];
    Table[Print["a(", n, ") = ", a[n]]; a[n], {n, 1, 25}] (* Jean-François Alcover, Jan 21 2018 *)
  • PARI
    ap3(v)=for(i=1,#v-2, for(j=i+2,#v, my(t=v[i]+v[j]); if(t%2==0 && setsearch(v,t/2), return(1)))); 0
    a(N)=forstep(n=N,2,-1, forvec(v=vector(n,i,[1,N]),if(!ap3(v), return(n)),2)); N \\ Charles R Greathouse IV, Apr 22 2022

Formula

Sanders proves that a(n) << n*(log log n)^5/log n. - Charles R Greathouse IV, Jan 22 2016
Bloom & Sisask prove that a(n) << n/(log n)^c for some c > 1. - Charles R Greathouse IV, Oct 11 2022

Extensions

Extended from 53 terms to 80 terms, using a simple brute-force program with some pruning, by Shreevatsa R, Oct 18 2009
See Dybizbanski (2012) for first 120 terms. - N. J. A. Sloane, Dec 17 2013
Edited by N. J. A. Sloane, Apr 12 2016
a(0)=0 prepended by Alois P. Heinz, May 14 2020

A003003 Size of the largest subset of the numbers [1...n] which doesn't contain a 4-term arithmetic progression.

Original entry on oeis.org

1, 2, 3, 3, 4, 5, 5, 6, 7, 8, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 16, 17, 17, 18, 18, 18, 19, 20, 20, 20, 21, 21, 21, 22, 22, 22, 23, 23, 24, 24, 24, 25, 25, 26, 26, 26, 27, 28, 28, 28, 28, 29, 29, 30, 30, 30, 30, 31, 31, 32, 32, 33, 33, 34, 34, 34
Offset: 1

Views

Author

Keywords

Comments

These subsets have been called 4-free sequences.
Szemeredi's theorem for arithmetic progressions of length 4 asserts that a(n) is o(n) as n -> infinity. - Doron Zeilberger, Mar 26 2008
False g.f. (z^12 + 1 - z^11 - z^10 + z^8 - z^6 + z^5 - z^3 + z)/((z+1)*(z-1)^2) was conjectured by Simon Plouffe in his 1992 dissertation, but in fact is wrong (cf. A136746).

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

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.

Extensions

a(52)-a(72) from Rob Pratt, Jul 09 2015

A101884 Smallest increasing natural number sequence without any length 3 equidistant arithmetic subsequences.

Original entry on oeis.org

1, 2, 4, 5, 8, 9, 11, 12, 16, 18, 19, 21, 26, 28, 29, 32, 33, 35, 36, 39, 43, 44, 46, 47, 54, 56, 59, 60, 62, 63, 68, 69, 71, 72, 80, 82, 86, 88, 91, 93, 94, 99, 103, 106, 113, 115, 116, 120, 122, 127, 130, 131, 133, 134, 137, 141, 142, 144, 145, 149, 154
Offset: 1

Views

Author

Douglas Stones (dssto1(AT)student.monash.edu.au), Dec 20 2004

Keywords

Comments

If the restriction "increasing" is removed sequence A094870 is obtained.

Examples

			3 is out because of 1,2,3. 7 is out because of 1,4,7.
8 is allowed even though 2,5,8 appears in the sequence, because 2, 5, and 8 are not spaced equidistant within the sequence.
		

Crossrefs

Programs

  • Maple
    lim:=61: a[1]:=1:a[2]:=2: for n from 3 to lim do na := {}: for j from 1 to floor((n-1)/2) do na := na union {2*a[n-j]-a[n-2*j]}: od: for j from a[n-1]+1 do if(not member(j,na))then a[n]:=j:break: fi: od:od: seq(a[n],n=1..lim); # Nathaniel Johnston, Jun 16 2011

A101888 Smallest natural number sequence without any length 5 equidistant arithmetic subsequences.

Original entry on oeis.org

1, 2, 3, 4, 6, 7, 8, 9, 11, 12, 13, 14, 16, 17, 18, 19, 22, 23, 24, 25, 27, 28, 29, 30, 32, 33, 34, 35, 37, 38, 39, 40, 43, 44, 45, 46, 48, 49, 50, 51, 53, 54, 55, 56, 58, 59, 60, 61, 64, 65, 66, 67, 69, 70, 71, 72, 74, 75, 76, 77, 79, 80, 81, 82, 86, 87, 88, 90, 91, 92, 93, 95
Offset: 1

Views

Author

Douglas Stones (dssto1(AT)student.monash.edu.au), Dec 20 2004

Keywords

Examples

			5 is out because of 1,2,3,4,5. 21 is out because of 1,6,11,16,21.
		

Crossrefs

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.

A236697 First differences of A131741.

Original entry on oeis.org

1, 2, 6, 2, 16, 2, 6, 4, 26, 6, 10, 6, 12, 6, 20, 12, 18, 22, 14, 34, 6, 30, 8, 10, 26, 24, 6, 42, 10, 8, 4, 8, 22, 2, 34, 24, 8, 10, 54, 8, 42, 28, 6, 96, 26, 40, 14, 60, 4, 20, 30, 46, 26, 12, 42, 28, 2, 70, 8, 126, 4, 26, 34, 6, 42, 18, 96, 26, 48, 4
Offset: 1

Views

Author

Zak Seidov, Jan 30 2014

Keywords

Comments

Among first 10000 terms, the largest is a(7790) = 17412.

Crossrefs

Formula

a(n) = A131741(n+1) - A131741(n).
Showing 1-7 of 7 results.