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-2 of 2 results.

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

A236246 Indices n for which A229037(n)=1.

Original entry on oeis.org

1, 2, 4, 5, 10, 11, 13, 14, 28, 29, 31, 32, 37, 38, 40, 41, 82, 83, 85, 86, 92, 93, 96, 105, 111, 112, 115, 116, 122, 177, 236, 237, 244, 245, 247, 266, 267, 270, 276, 277, 283, 294, 301, 302, 347, 558, 628, 638, 646, 647, 649, 655, 669, 674, 685, 686
Offset: 1

Views

Author

M. F. Hasler, Jan 20 2014

Keywords

Comments

Charles R Greathouse IV asked for a proof showing that this sequence is infinite (SeqFan mailing list, Jan 2014).
Significant jumps occur at a(3)=4=2*a(2), a(5)=10=2*a(4), a(9)=28=2*a(8), a(17)=82=2*a(16), a(31)=236 >> a(29)=122, a(47)=628 >> a(44)=302, a(70)=1622 >> a(66)=809, a(90)=4165 >> a(87)=2062, ... . Here, the size of the terms roughly doubles over the interval of very few indices. The indices such that a(n[k]) >= 2*a(n[k-1]) are n[k] = 3, 5, 9, 17, 30, 46, 69, 89, ... .
This sequence first differs from A003278 at the 21st term, which is 92 here but 91 in A003278. Up to 91, each natural number n that did not appear in this sequence failed to do so because there were two smaller numbers n-a and n-2a, with A229037(n-a) and A229037(n-2a) both equal to 1. 91 is missing from this sequence; in other words, A229037(91) is not 1, because A229037(27) = 9 and A229037(59) = 5. - Jack W Grahl, Dec 28 2014

Crossrefs

Subsequence of A241673.

Programs

  • Haskell
    a236246 n = a236246_list !! (n-1)
    a236246_list = filter ((== 1) . a229037) [1..]
    -- Reinhard Zumkeller, Apr 26 2014
    
  • Python
    A236246_list, 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)
        if j == 1:
            A236246_list.append(n+1) # Chai Wah Wu, Dec 25 2014
Showing 1-2 of 2 results.