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-10 of 19 results. Next

A005836 Numbers whose base-3 representation contains no 2.

Original entry on oeis.org

0, 1, 3, 4, 9, 10, 12, 13, 27, 28, 30, 31, 36, 37, 39, 40, 81, 82, 84, 85, 90, 91, 93, 94, 108, 109, 111, 112, 117, 118, 120, 121, 243, 244, 246, 247, 252, 253, 255, 256, 270, 271, 273, 274, 279, 280, 282, 283, 324, 325, 327, 328, 333, 334, 336, 337, 351, 352
Offset: 1

Views

Author

Keywords

Comments

3 does not divide binomial(2s, s) if and only if s is a member of this sequence, where binomial(2s, s) = A000984(s) are the central binomial coefficients.
This is the lexicographically earliest increasing sequence of nonnegative numbers that contains no arithmetic progression of length 3. - Robert Craigen (craigenr(AT)cc.umanitoba.ca), Jan 29 2001
In the notation of A185256 this is the Stanley Sequence S(0,1). - N. J. A. Sloane, Mar 19 2010
Complement of A074940. - Reinhard Zumkeller, Mar 23 2003
Sums of distinct powers of 3. - Ralf Stephan, Apr 27 2003
Numbers n such that central trinomial coefficient A002426(n) == 1 (mod 3). - Emeric Deutsch and Bruce E. Sagan, Dec 04 2003
A039966(a(n)+1) = 1; A104406(n) = number of terms <= n.
Subsequence of A125292; A125291(a(n)) = 1 for n>1. - Reinhard Zumkeller, Nov 26 2006
Also final value of n - 1 written in base 2 and then read in base 3 and with finally the result translated in base 10. - Philippe LALLOUET (philip.lallouet(AT)wanadoo.fr), Jun 23 2007
a(n) modulo 2 is the Thue-Morse sequence A010060. - Dennis Tseng, Jul 16 2009
Also numbers such that the balanced ternary representation is the same as the base 3 representation. - Alonso del Arte, Feb 25 2011
Fixed point of the morphism: 0 -> 01; 1 -> 34; 2 -> 67; ...; n -> (3n)(3n+1), starting from a(1) = 0. - Philippe Deléham, Oct 22 2011
It appears that this sequence lists the values of n which satisfy the condition sum(binomial(n, k)^(2*j), k = 0..n) mod 3 <> 0, for any j, with offset 0. See Maple code. - Gary Detlefs, Nov 28 2011
Also, it follows from the above comment by Philippe Lallouet that the sequence must be generated by the rules: a(1) = 0, and if m is in the sequence then so are 3*m and 3*m + 1. - L. Edson Jeffery, Nov 20 2015
Add 1 to each term and we get A003278. - N. J. A. Sloane, Dec 01 2019

Examples

			12 is a term because 12 = 110_3.
This sequence regarded as a triangle with rows of lengths 1, 1, 2, 4, 8, 16, ...:
   0
   1
   3,  4
   9, 10, 12, 13
  27, 28, 30, 31, 36, 37, 39, 40
  81, 82, 84, 85, 90, 91, 93, 94, 108, 109, 111, 112, 117, 118, 120, 121
... - _Philippe Deléham_, Jun 06 2015
		

References

  • Richard K. Guy, Unsolved Problems in Number Theory, 3rd Edition, Springer, 2004, Section E10, pp. 317-323.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A039966 (characteristic function).
For generating functions Product_{k>=0} (1+a*x^(b^k)) for the following values of (a,b) see: (1,2) A000012 and A000027, (1,3) A039966 and A005836, (1,4) A151666 and A000695, (1,5) A151667 and A033042, (2,2) A001316, (2,3) A151668, (2,4) A151669, (2,5) A151670, (3,2) A048883, (3,3) A117940, (3,4) A151665, (3,5) A151671, (4,2) A102376, (4,3) A151672, (4,4) A151673, (4,5) A151674.
Row 3 of array A104257.
Summary of increasing sequences avoiding arithmetic progressions of specified lengths (the second of each pair is obtained by adding 1 to the first):
3-term AP: A005836 (>=0), A003278 (>0);
4-term AP: A005839 (>=0), A005837 (>0);
5-term AP: A020654 (>=0), A020655 (>0);
6-term AP: A020656 (>=0), A005838 (>0);
7-term AP: A020657 (>=0), A020658 (>0);
8-term AP: A020659 (>=0), A020660 (>0);
9-term AP: A020661 (>=0), A020662 (>0);
10-term AP: A020663 (>=0), A020664 (>0).
See also A000452.

Programs

  • Haskell
    a005836 n = a005836_list !! (n-1)
    a005836_list = filter ((== 1) . a039966) [0..]
    -- Reinhard Zumkeller, Jun 09 2012, Sep 29 2011
    
  • Julia
    function a(n)
        m, r, b = n, 0, 1
        while m > 0
            m, q = divrem(m, 2)
            r += b * q
            b *= 3
        end
    r end; [a(n) for n in 0:57] |> println # Peter Luschny, Jan 03 2021
  • Maple
    t := (j, n) -> add(binomial(n,k)^j, k=0..n):
    for i from 1 to 400 do
        if(t(4,i) mod 3 <>0) then print(i) fi
    od; # Gary Detlefs, Nov 28 2011
    # alternative Maple program:
    a:= proc(n) option remember: local k, m:
    if n=1 then 0 elif n=2 then 1 elif n>2 then k:=floor(log[2](n-1)): m:=n-2^k: procname(m)+3^k: fi: end proc:
    seq(a(n), n=1.. 20); # Paul Weisenhorn, Mar 22 2020
    # third Maple program:
    a:= n-> `if`(n=1, 0, irem(n-1, 2, 'q')+3*a(q+1)):
    seq(a(n), n=1..100);  # Alois P. Heinz, Jan 26 2022
  • Mathematica
    Table[FromDigits[IntegerDigits[k, 2], 3], {k, 60}]
    Select[Range[0, 400], DigitCount[#, 3, 2] == 0 &] (* Harvey P. Dale, Jan 04 2012 *)
    Join[{0}, Accumulate[Table[(3^IntegerExponent[n, 2] + 1)/2, {n, 57}]]] (* IWABUCHI Yu(u)ki, Aug 01 2012 *)
    FromDigits[#,3]&/@Tuples[{0,1},7] (* Harvey P. Dale, May 10 2019 *)
  • PARI
    A=vector(100);for(n=2,#A,A[n]=if(n%2,3*A[n\2+1],A[n-1]+1));A \\ Charles R Greathouse IV, Jul 24 2012
    
  • PARI
    is(n)=while(n,if(n%3>1,return(0));n\=3);1 \\ Charles R Greathouse IV, Mar 07 2013
    
  • PARI
    a(n) = fromdigits(binary(n-1),3);  \\ Gheorghe Coserea, Jun 15 2018
    
  • Python
    def A005836(n):
        return int(format(n-1,'b'),3) # Chai Wah Wu, Jan 04 2015
    

Formula

a(n) = A005823(n)/2 = A003278(n)-1 = A033159(n)-2 = A033162(n)-3.
Numbers n such that the coefficient of x^n is > 0 in prod (k >= 0, 1 + x^(3^k)). - Benoit Cloitre, Jul 29 2003
a(n+1) = Sum_{k=0..m} b(k)* 3^k and n = Sum( b(k)* 2^k ).
a(2n+1) = 3a(n+1), a(2n+2) = a(2n+1) + 1, a(0) = 0.
a(n+1) = 3*a(floor(n/2)) + n - 2*floor(n/2). - Ralf Stephan, Apr 27 2003
G.f.: (x/(1-x)) * Sum_{k>=0} 3^k*x^2^k/(1+x^2^k). - Ralf Stephan, Apr 27 2003
a(n) = Sum_{k = 1..n-1} (1 + 3^A007814(k)) / 2. - Philippe Deléham, Jul 09 2005
From Reinhard Zumkeller, Mar 02 2008: (Start)
A081603(a(n)) = 0.
If the offset were changed to zero, then: a(0) = 0, a(n+1) = f(a(n)+1, a(n)+1) where f(x, y) = if x < 3 and x <> 2 then y else if x mod 3 = 2 then f(y+1, y+1) else f(floor(x/3), y). (End)
With offset a(0) = 0: a(n) = Sum_{k>=0} A030308(n,k)*3^k. - Philippe Deléham, Oct 15 2011
a(2^n) = A003462(n). - Philippe Deléham, Jun 06 2015
We have liminf_{n->infinity} a(n)/n^(log(3)/log(2)) = 1/2 and limsup_{n->infinity} a(n)/n^(log(3)/log(2)) = 1. - Gheorghe Coserea, Sep 13 2015
a(2^k+m) = a(m) + 3^k with 1 <= m <= 2^k and 1 <= k, a(1)=0, a(2)=1. - Paul Weisenhorn, Mar 22 2020
Sum_{n>=2} 1/a(n) = 2.682853110966175430853916904584699374821677091415714815171756609672281184705... (calculated using Baillie and Schmelzer's kempnerSums.nb, see Links). - Amiram Eldar, Feb 12 2022
A065361(a(n)) = n-1. - Rémy Sigrist, Feb 06 2023
a(n) ≍ n^k, where k = log 3/log 2 = 1.5849625007. (I believe the constant varies from 1/2 to 1.) - Charles R Greathouse IV, Mar 29 2024

Extensions

Offset corrected by N. J. A. Sloane, Mar 02 2008
Edited by the Associate Editors of the OEIS, Apr 07 2009

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

A185256 Stanley Sequence S(0,3).

Original entry on oeis.org

0, 3, 4, 7, 9, 12, 13, 16, 27, 30, 31, 34, 36, 39, 40, 43, 81, 84, 85, 88, 90, 93, 94, 97, 108, 111, 112, 115, 117, 120, 121, 124, 243, 246, 247, 250, 252, 255, 256, 259, 270, 273, 274, 277, 279, 282, 283, 286, 324, 327, 328, 331, 333, 336, 337, 340, 351, 354, 355, 358, 360, 363
Offset: 1

Views

Author

N. J. A. Sloane, Mar 19 2011

Keywords

Comments

Given a finite increasing sequence V = [v_1, ..., v_k] containing no 3-term arithmetic progression, the Stanley Sequence S(V) is obtained by repeatedly appending the smallest term that is greater than the previous term and such that the new sequence also contains no 3-term arithmetic progression.

Examples

			After [0, 3, 4, 7, 9] the next term cannot be 10 or we would have the 3-term A.P. 4,7,10; it cannot be 11 because of 7,9,11; but 12 is OK.
		

References

  • R. K. Guy, Unsolved Problems in Number Theory, E10.

Crossrefs

For other examples of Stanley Sequences see A005487, A005836, A187843, A188052, A188053, A188054, A188055, A188056, A188057.
See also A004793, A033160, A033163.

Programs

  • Maple
    # Stanley Sequences, Discrete Math. vol. 311 (2011), see p. 560
    ss:=proc(s1,M) local n,chvec,swi,p,s2,i,j,t1,mmm; t1:=nops(s1); mmm:=1000;
    s2:=Array(1..t1+M,s1); chvec:=Array(0..mmm);
    for i from 1 to t1 do chvec[s2[i]]:=1; od;
    # Get n-th term:
    for n from t1+1 to t1+M do # do 1
    # Try i as next term:
    for i from s2[n-1]+1 to mmm do # do 2
    swi:=-1;
    # Test against j-th term:
    for j from 1 to n-2 do # do 3
    p:=s2[n-j];
    if 2*p-i < 0 then break; fi;
    if chvec[2*p-i] = 1 then swi:=1; break; fi;
    od; # od 3
    if swi=-1 then s2[n]:=i; chvec[i]:=1; break; fi;
    od; # od 2
    if swi=1 then ERROR("Error, no solution at n = ",n); fi;
    od; # od 1;
    [seq(s2[i],i=1..t1+M)];
    end;
    ss([0,3],80);
  • Mathematica
    ss[s1_, M_] := Module[{n, chvec, swi, p, s2, i, j, t1, mmm}, t1 = Length[s1]; mmm = 1000; s2 = Table[s1, {t1 + M}] // Flatten; chvec = Array[0&, mmm];
    For[i = 1, i <= t1, i++, chvec[[s2[[i]] ]] = 1];
    (* get n-th term *)
    For[n = t1+1, n <= t1 + M, n++,
    (* try i as next term *)
    For[i = s2[[n-1]] + 1, i <= mmm, i++, swi = -1;
    (* test against j-th term *)
    For[j = 1, j <= n-2, j++, p = s2[[n - j]]; If[2*p - i < 0, Break[] ];
    If[chvec[[2*p - i]] == 1, swi = 1; Break[] ] ];
    If[swi == -1, s2[[n]] = i; chvec[[i]] = 1; Break[] ] ];
    If[swi == 1, Print["Error, no solution at n = ", n] ] ];
    Table[s2[[i]], {i, 1, t1 + M}] ];
    ss[{0, 3}, 80] (* Jean-François Alcover, Sep 10 2013, translated from Maple *)
  • PARI
    A185256(n,show=1,L=3,v=[0,3], D=v->v[2..-1]-v[1..-2])={while(#v1||next(2), 2); break)); if(type(show)=="t_VEC", v, v[n])} \\ 2nd (optional) arg: zero = silent, nonzero = verbose, vector (e.g. [] or [1]) = get the whole list [a(1..n)] as return value, else just a(n). - M. F. Hasler, Jan 18 2016

A092482 Sequence contains no 3-term arithmetic progression, other than its initial terms 1, 2, 3.

Original entry on oeis.org

1, 2, 3, 6, 7, 14, 15, 17, 18, 36, 37, 39, 40, 45, 46, 48, 49, 98, 99, 101, 102, 107, 108, 110, 111, 125, 126, 128, 129, 134, 135, 137, 138, 276, 277, 279, 280, 285, 286, 288, 289, 303, 304, 306, 307, 312, 313, 315, 316, 357, 358, 360, 361, 366, 367, 369, 370
Offset: 1

Views

Author

Ralf Stephan, Apr 04 2004

Keywords

Comments

a(1)=1, a(2)=2, a(3)=3; a(n) is least k such that no three terms of a(1), a(2), ..., a(n-1), k form an arithmetic progression, except for the first triple (1,2,3).

Crossrefs

Programs

  • Mathematica
    a[n_] := a[n] = If[n < 4, n, For[k = a[n - 1] + 1, True, k++, sp = SequencePosition[Append[Array[a, n - 1], k], {x_, _, y_, _, z_} /; y - x == z - y, 2]; If[sp == {{1, 3}}, Return[k]]]];
    Table[Print[n, " ", a[n]]; a[n], {n, 1, 512}]
    (* Comparing with data from conjectured formula: *)
    b[n_] := If[n < 4, n, 1 + 2^(Length[id = IntegerDigits[n - 2, 2]] - 1) + FromDigits[id, 3]];
    Table[b[n], {n, 1, 512}] (* Jean-François Alcover, Jan 15 2019 *)
    (* Second [much faster] program: *)
    upto[m_] := Module[{n, v, i, j}, n = Max[m, 3]; v = Table[1, {n}]; For[i = 3, i <= n-1, i++, If[v[[i]] == 1, For[j = Max[1, 2i-n], j <= Min[2n-i, i-1], j++, If[v[[j]] == 1, v[[2i-j]] = 0]]]]; Position[v, 1] // Flatten]; upto[12000] (* Jean-François Alcover, Jan 16 2019, after David A. Corneth *)
  • PARI
    upto(n) = n=max(n,3); v=vector(n, i, 1); for(i=3, n-1, if(v[i]==1, for(j = max(1, 2*i-n), min(2*n-i,i-1), c=2*i - j; if(v[j]==1, v[2*i-j]=0; )))); select(x -> x==1, v, 1) \\ David A. Corneth, Jan 15 2019

Formula

For n > 2, a(n+2) = 1 + 2^floor(log_2(n)) + Sum_{k=1..n} (3^A007814(n) + 1)/2 = 1 + A053644(n) + A005836(n) (conjectured and checked up to n=512).

Extensions

Name clarified by Charles R Greathouse IV, Jan 30 2014

A093682 Array T(m,n) by antidiagonals: nonarithmetic-3-progression sequences with simple closed forms.

Original entry on oeis.org

1, 2, 1, 4, 3, 1, 5, 4, 4, 1, 10, 6, 5, 7, 1, 11, 10, 8, 8, 10, 1, 13, 12, 10, 10, 11, 19, 1, 14, 13, 13, 11, 13, 20, 28, 1, 28, 15, 14, 16, 14, 22, 29, 55, 1, 29, 28, 17, 17, 20, 23, 31, 56, 82, 1, 31, 30, 28, 20, 22, 28, 32, 58, 83, 163, 1, 32, 31, 31, 28, 23, 29, 37, 59, 85
Offset: 0

Views

Author

Ralf Stephan, Apr 09 2004

Keywords

Comments

The nonarithmetic-3-progression sequences starting with a(1)=1, a(2)=1+3^m or 1+2*3^m, m >= 0, seem to have especially simple 'closed' forms. None of these formulas have been proved, however.
T(m,1)=1, T(m,2) = 1 + (1 + [m even])*3^floor(m/2) = 1 + A038754(m), m >= 0, n > 0; T(m,n) is least k such that no three terms of T(m,1), T(m,2), ..., T(m,n-1), k form an arithmetic progression.

Examples

			Array begins:
  1,  2,  4,  5, 10, 11, 13, ...
  1,  3,  4,  6, 10, 12, 13, ...
  1,  4,  5,  8, 10, 13, 14, ...
  1,  7,  8, 10, 11, 16, 17, ...
  1, 10, 11, 13, 14, 20, 22, ...
  ...
		

Crossrefs

Column 2 is 1+A038754. Cf. A092482, A033158.

Formula

T(m, n) = (Sum_{k=1..n-1} (3^A007814(k) + 1)/2) + f(n), with f(n) a P-periodic function, where P <= 2^floor((m+3)/2) (conjectured and checked up to m=13, n=1000).
The formula implies that T(m, n) = b(n-1) where b(2n) = 3b(n) + p(n), b(2n+1) = 3b(n) + q(n), with p, q sequences generated by rational o.g.f.s.

A033157 Begins with (1, 4); avoids 3-term arithmetic progressions.

Original entry on oeis.org

1, 4, 5, 8, 10, 13, 14, 17, 28, 31, 32, 35, 37, 40, 41, 44, 82, 85, 86, 89, 91, 94, 95, 98, 109, 112, 113, 116, 118, 121, 122, 125, 244, 247, 248, 251, 253, 256, 257, 260, 271, 274, 275, 278, 280, 283, 284, 287, 325, 328, 329, 332, 334, 337, 338, 341, 352, 355, 356, 359, 361
Offset: 1

Views

Author

Keywords

Comments

Also called Stanley Sequence S[1,4]. - Ralf Stephan, Jan 31 2014

References

  • F. Iacobescu, 'Smarandache Partition Type and Other Sequences.' Bull. Pure Appl. Sci. 16E, 237-240, 1997.
  • H. Ibstedt, A Few Smarandache Sequences, Smarandache Notions Journal, Vol. 8, No. 1-2-3, 1997, 170-183.

Crossrefs

Cf. A092482, A004793. Row 2 of array in A093682.

Programs

  • PARI
    Da(n)=if(n<1,1,if(n%2==0,3*Da(n/2)+5-13*((n/2)%2)-6*((n/2)%4==2),3)) /* Ralf Stephan */

Formula

Partial sums of Da(n), where Da(n) is defined in the PARI program.
a(n) = A004793(n) + [n is even] + [ceiling(n/2) is even]. Proof by Lawrence Sze. - Ralf Stephan, Nov 15 2004
a(n) = A033161(n) - 1 = A185256(n) + 1. - Ralf Stephan, Jan 31 2014

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

A093678 Sequence contains no 3-term arithmetic progression, starting with 1, 7.

Original entry on oeis.org

1, 7, 8, 10, 11, 16, 17, 20, 28, 34, 35, 37, 38, 43, 44, 47, 82, 88, 89, 91, 92, 97, 98, 101, 109, 115, 116, 118, 119, 124, 125, 128, 244, 250, 251, 253, 254, 259, 260, 263, 271, 277, 278, 280, 281, 286, 287, 290, 325, 331, 332, 334, 335, 340, 341, 344, 352
Offset: 1

Views

Author

Ralf Stephan, Apr 09 2004

Keywords

Comments

a(1)=1, a(2)=7; a(n) is least k such that no three terms of a(1), a(2), ..., a(n-1), k form an arithmetic progression.

Crossrefs

Row 3 of array in A093682.

Programs

  • Maple
    N:= 1000: # to get all terms <= N
    V:= Vector(N,1):
    A[1]:= 1: A[2]:= 7: k:= 8;
    for n from 3 while k < N do
      for k from 1 to n-2 do
        p:= 2*A[n-1]-A[k];
        if p <= N then V[p]:= 0 fi
      od:
      for k from A[n-1]+1 to N do
        if V[k] = 1 then A[n]:= k; nmax:= n; break fi;
      od;
    od:
    seq(A[i],i=1..nmax); # Robert Israel, May 07 2018
  • Mathematica
    a[n_] := Sum[(1/2)(3^IntegerExponent[k, 2]+1), {k, 1, n-1}] + (1/8)( 12(-1)^n - 7Sin[n Pi/2] + 7Sin[3n Pi/2] - Sin[(n+1)Pi/4] + Sin[(5n+1) Pi/4] + Cos[n Pi/2] + Cos[3n Pi/2] + Cos[n Pi/4] + Cos[3n Pi/4] + Cos[5n Pi/4] + Cos[7n Pi/4] + Cos[(3n+1)Pi/4] - Cos[(7n+1)Pi/4] + 38); Array[a, 60] (* Jean-François Alcover, Mar 22 2019 *)

Formula

a(n) = (Sum_{k=1..n-1} (3^A007814(k) + 1)/2) + f(n), with f(n) an 8-periodic function with values {1, 6, 5, 6, 2, 6, 5, 7, ...}, as proved by Lawrence Sze.

A093679 Sequence contains no 3-term arithmetic progression, starting with 1, 10.

Original entry on oeis.org

1, 10, 11, 13, 14, 20, 22, 23, 28, 37, 38, 40, 41, 47, 49, 50, 82, 91, 92, 94, 95, 101, 103, 104, 109, 118, 119, 121, 122, 128, 130, 131, 244, 253, 254, 256, 257, 263, 265, 266, 271, 280, 281, 283, 284, 290, 292, 293, 325, 334, 335, 337, 338, 344, 346, 347
Offset: 1

Views

Author

Ralf Stephan, Apr 09 2004

Keywords

Comments

a(1)=1, a(2)=10; a(n) is least k such that no three terms of a(1), a(2), ..., a(n-1), k form an arithmetic progression.

Crossrefs

Row 4 of array in A093682.

Formula

a(n) = (Sum_{k=1..n-1} (3^A007814(k) + 1)/2) + f(n), with f(n) an 8-periodic function with values {1, 9, 8, 9, 5, 10, 10, 10, ...}, n >= 1, as proved by Lawrence Sze.
Showing 1-10 of 19 results. Next