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

A236774 A236269(n) - A236313(n).

Original entry on oeis.org

3, -1, 1, -1, 0, 2, 6, -11, 4, 0, 3, -4, 5, 3, 6, -24, 4, 0, 4, 5, 3, 5, 17, -10, 2, 3, 6, 21, 18, 7, 5, -105, 0, 3, 0, 6, 8, 10, 9, -7, 7, 1, 14, 1, 1, 1, 5, -23, 47, 5, 4, 20, 11, 19, 10, -10, 20, 0, 5, 0, 49, 3, 20, -347, 29, -1, 5, 0, 3, 4, 3, -13, 1, 18, 9, -1, 23, 1, 12, -36, 54, 0, 75, 16, 2, 5, 40
Offset: 1

Views

Author

Ralf Stephan, Jan 31 2014

Keywords

Comments

Known formulas for first differences of Stanley sequences are sums with one term always being A236313(n), so it makes sense in order to find a formula for the first differences of the Stanley sequence S[0,4] to subtract A236313(n) from that and look if something shows.
a(n) is negative for n = 2,4,8,12,16,24,32,40,48,56,64,66,72... and it appears that n is always even if a(n) is negative. It also seems that a(n) is always negative if n is a power of two, with a(2^m) = -1,-1,-11,-24,-105,-347,-1073,-3260,-9839,-29467,-85479,-265530...

Programs

  • PARI
    NAP(sv,N)=local(v,vv,m,k,l,sl,vvl);sl=length(sv);vvl=min(N*N,10^6);v=vector(N);vv=vector(vvl);for(k=1,sl,v[k]=sv[k];for(l=1,k-1,vv[2*v[k]-v[l]]=1));m=v[sl]+1;for(k=sl+1,N,while(m<=vvl&&vv[m],m=m+1);if(m>vvl,return(v));for(l=1,k-1,sl=2*m-v[l];if(sl<=vvl,vv[sl]=1));vv[m]=1;v[k]=m);v
    v=NAP([0,4],5000)
    a(n)=v[n+1]-v[n]-(3^valuation(n,2)+1)/2

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

A262096 Triangle read by rows: numbers c from the set of arithmetic triples a < b < c (three numbers in arithmetic progression) where a and b are terms of A005836.

Original entry on oeis.org

2, 6, 5, 8, 7, 5, 18, 17, 15, 14, 20, 19, 17, 16, 11, 24, 23, 21, 20, 15, 14, 26, 25, 23, 22, 17, 16, 14, 54, 53, 51, 50, 45, 44, 42, 41, 56, 55, 53, 52, 47, 46, 44, 43, 29, 60, 59, 57, 56, 51, 50, 48, 47, 33, 32, 62, 61, 59, 58, 53, 52, 50, 49, 35, 34, 32
Offset: 1

Views

Author

Max Barrentine, Sep 10 2015

Keywords

Comments

The first term in each row of the triangle is a term of A005823; these are also the local maxima. From this term until the next row, the first differences are A236313.

Examples

			Each term is generated from arithmetic sequences started from pairs of terms from A005836. The order is according to the arithmetic triples 0, 1, a(1)=2; 0, 3, a(2)=6; 1, 3, a(3)=5; 0, 4, a(4)=8; 1, 4, a(5)=7; 3, 4, a(6)=5; ...
As a triangle, sequence starts:
   2;
   6,  5;
   8,  7,  5;
  18, 17, 15, 14;
  20, 19, 17, 16, 11;
  24, 23, 21, 20, 15, 14;
  26, 25, 23, 22, 17, 16, 14;
  54, 53, 51, 50, 45, 44, 42, 41;
  ...
		

Crossrefs

Programs

  • PARI
    isok(n) = (n==0) || (vecmax(digits(n, 3)) != 2);
    lista(nn) = {oks = select(x->isok(x), vector(nn, n, n-1)); for (n=2, #oks, for (k=1, n-1, print1(2*oks[n]-oks[k], ", ");););} \\ Michel Marcus, Sep 12 2015

Extensions

Name corrected by Max Barrentine, May 24 2016

A368316 Lexicographically earliest sequence of distinct nonnegative integers such that for any n >= 0, a(n) and Sum_{k = 0..n-1} a(k) can be added without carries in balanced ternary.

Original entry on oeis.org

0, 1, 2, 5, 3, 15, 4, 6, 41, 9, 18, 10, 125, 12, 16, 8, 45, 13, 14, 369, 27, 54, 28, 11, 7, 126, 17, 55, 26, 1107, 30, 51, 31, 131, 36, 46, 29, 375, 37, 44, 39, 123, 40, 42, 35, 3285, 57, 24, 135, 81, 405, 82, 38, 19, 132, 53, 1134, 84, 25, 134, 85, 23, 378
Offset: 0

Views

Author

Rémy Sigrist, Dec 21 2023

Keywords

Comments

Two integers can be added without carries in balanced ternary if they have no equal nonzero digit at the same position.
If we restrict ourselves to positive integers and allow duplicates, then we obtain A236313.
This sequence can be seen as a variant of A278742; however, the present sequence is not strictly increasing.
Will every nonnegative integer appear in the sequence?

Examples

			The first terms, alongside the balanced ternary expansions of a(n) and b(n) = Sum_{k = 0..n-1} a(k), are:
  n           |  0  1   2    3    4     5     6     7      8      9     10
  a(n)        |  0  1   2    5    3    15     4     6     41      9     18
  bter(b(n))  |  0  0   1   10  10T   11T  100T  1010   1100  100TT  101TT
  bter(a(n))  |  0  1  1T  1TT   10  1TT0    11   1T0  1TTTT    100   1T00
		

Crossrefs

Programs

  • PARI
    See Links section.
Showing 1-4 of 4 results.