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 27 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

A003278 Szekeres's sequence: a(n)-1 in ternary = n-1 in binary; also: a(1) = 1, a(2) = 2, and thereafter a(n) is smallest number k which avoids any 3-term arithmetic progression in a(1), a(2), ..., a(n-1), k.

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, 91, 92, 94, 95, 109, 110, 112, 113, 118, 119, 121, 122, 244, 245, 247, 248, 253, 254, 256, 257, 271, 272, 274, 275, 280, 281, 283, 284, 325, 326, 328, 329, 334, 335, 337, 338, 352, 353
Offset: 1

Views

Author

Keywords

Comments

That is, there are no three elements A, B and C such that B - A = C - B.
Positions of 1's in Richard Stanley's Forest Fire sequence A309890. - N. J. A. Sloane, Dec 01 2019
Subtracting 1 from each term gives A005836 (ternary representation contains no 2's). - N. J. A. Sloane, Dec 01 2019
Difference sequence related to Gray code bit sequence (A001511). The difference patterns follows a similar repeating pattern (ABACABADABACABAE...), but each new value is the sum of the previous values, rather than simply 1 more than the maximum of the previous values. - Hal Burch (hburch(AT)cs.cmu.edu), Jan 12 2004
Sums of distinct powers of 3, translated by 1.
Positions of 0 in A189820; complement of A189822. - Clark Kimberling, May 26 2011
Also, Stanley sequence S(1): see OEIS Index under Stanley sequences (link below). - M. F. Hasler, Jan 18 2016
Named after the Hungarian-Australian mathematician George Szekeres (1911-2005). - Amiram Eldar, May 07 2021
If A_n=(a(1),a(2),...,a(2^n)), then A_(n+1)=(A_n,A_n+3^n). - Arie Bos, Jul 24 2022

Examples

			G.f. = x + 2*x^2 + 4*x^3 + 5*x^4 + 10*x^5 + 11*x^6 + 13*x^7 + 14*x^8 + 28*x^9 + ...
		

References

  • Steven R. Finch, Mathematical Constants, Cambridge, 2003, p. 164.
  • Richard K. Guy, Unsolved Problems in Number Theory, E10.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Equals 1 + A005836. Cf. A001511, A098871.
Row 0 of array in A093682.
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).
Cf. A003002, A229037 (the Forest Fire sequence), A309890 (Stanley's version).
Similar formula:
If A_n=(a(1),a(2),...,a(2^n)), then A_(n+1)=(A_n,A_n+4^n) produces A098871;
If A_n=(a(1),a(2),...,a(2^n)), then A_(n+1)=(A_n,A_n+2*3^n) produces A191106.

Programs

  • Julia
    function a(n)
        return 1 + parse(Int, bitstring(n-1), base=3)
    end # Gabriel F. Lipnik, Apr 16 2021
  • Maple
    a:= proc(n) local m, r, b; m, r, b:= n-1, 1, 1;
          while m>0 do r:= r+b*irem(m, 2, 'm'); b:= b*3 od; r
        end:
    seq(a(n), n=1..100); # Alois P. Heinz, Aug 17 2013
  • Mathematica
    Take[ Sort[ Plus @@@ Subsets[ Table[3^n, {n, 0, 6}]]] + 1, 58] (* Robert G. Wilson v, Oct 23 2004 *)
    a[1] = 0; h = 180;
    Table[a[3 k - 2] = a[k], {k, 1, h}];
    Table[a[3 k - 1] = a[k], {k, 1, h}];
    Table[a[3 k] = 1, {k, 1, h}];
    Table[a[n], {n, 1, h}]   (* A189820 *)
    Flatten[Position[%, 0]]  (* A003278 *)
    Flatten[Position[%%, 1]] (* A189822 *)
    (* A003278 from A189820, from Clark Kimberling, May 26 2011 *)
    Table[FromDigits[IntegerDigits[n, 2], 3] + 1, {n, 0, 57}] (* Amit Munje, Jun 03 2018 *)
  • PARI
    a(n)=1+sum(i=1,n-1,(1+3^valuation(i,2))/2) \\ Ralf Stephan, Jan 21 2014
    
  • Perl
    $nxt = 1; @list = (); for ($cnt = 0; $cnt < 1500; $cnt++) { while (exists $legal{$nxt}) { $nxt++; } print "$nxt "; last if ($nxt >= 1000000); for ($i = 0; $i <= $#list; $i++) { $t = 2*$nxt - $list[$i]; $legal{$t} = -1; } $cnt++; push @list, $nxt; $nxt++; } # Hal Burch
    
  • Python
    def A003278(n):
        return int(format(n-1,'b'),3)+1 # Chai Wah Wu, Jan 04 2015
    

Formula

a(2*k + 2) = a(2*k + 1) + 1, a(2^k + 1) = 2*a(2^k).
a(n) = b(n+1) with b(0) = 1, b(2*n) = 3*b(n)-2, b(2*n+1) = 3*b(n)-1. - Ralf Stephan, Aug 23 2003
G.f.: x/(1-x)^2 + x * Sum_{k>=1} 3^(k-1)*x^(2^k)/((1-x^(2^k))*(1-x)). - Ralf Stephan, Sep 10 2003, corrected by Robert Israel, May 25 2011
Conjecture: a(n) = (A191107(n) + 2)/3 = (A055246(n) + 5)/6. - L. Edson Jeffery, Nov 26 2015
a(n) mod 2 = A010059(n). - Arie Bos, Aug 13 2022

A020654 Lexicographically earliest infinite increasing sequence of nonnegative numbers containing no 5-term arithmetic progression.

Original entry on oeis.org

0, 1, 2, 3, 5, 6, 7, 8, 10, 11, 12, 13, 15, 16, 17, 18, 25, 26, 27, 28, 30, 31, 32, 33, 35, 36, 37, 38, 40, 41, 42, 43, 50, 51, 52, 53, 55, 56, 57, 58, 60, 61, 62, 63, 65, 66, 67, 68, 75, 76, 77, 78, 80, 81, 82, 83, 85, 86, 87, 88, 90, 91, 92, 93, 125, 126, 127
Offset: 1

Views

Author

Keywords

Comments

This is also the set of numbers with no "4" in their base-5 representation. In fact, for any prime p, the sequence consisting of numbers with no (p-1) in their base-p expansion is the same as the earliest sequence containing no p-term arithmetic progression. - Nathaniel Johnston, Jun 26-27 2011

Crossrefs

Cf. A023717.
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).

Programs

  • Julia
    function a(n)
        m, r, b = n, 0, 1
        while m > 0
            m, q = divrem(m, 4)
            r += b * q
            b *= 5
        end
    r end; [a(n) for n in 0:66] |> println # Peter Luschny, Jan 03 2021
  • Maple
    seq(`if`(numboccur(4,convert(n,base,5))=0,n,NULL),n=0..127); # Nathaniel Johnston, Jun 27 2011
  • Mathematica
    Select[ Range[ 0, 100 ], (Count[ IntegerDigits[ #, 5 ], 4 ]==0)& ]
    Select[Range[0, 120], DigitCount[#, 5, 4] == 0 &] (* Amiram Eldar, Apr 14 2025 *)
  • PARI
    is(n)=while(n>4, if(n%5==4, return(0)); n\=5); 1 \\ Charles R Greathouse IV, Feb 12 2017
    
  • Python
    from sympy.ntheory.factor_ import digits
    print([n for n in range(201) if digits(n, 5)[1:].count(4)==0]) # Indranil Ghosh, May 23 2017
    
  • Python
    from gmpy2 import digits
    def A020654(n): return int(digits(n-1,4),5) # Chai Wah Wu, May 06 2025
    

Formula

Sum_{n>=2} 1/a(n) = 7.7794910022243020875287956248411192066951785182667316905881486574421016471305408306837031955619272391023... (calculated using Baillie and Schmelzer's kempnerSums.nb, see Links). - Amiram Eldar, Apr 14 2025

Extensions

Added "infinite" to definition. - N. J. A. Sloane, Sep 28 2019

A020657 Lexicographically earliest increasing sequence of nonnegative numbers that contains no arithmetic progression of length 7.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 7, 8, 9, 10, 11, 12, 14, 15, 16, 17, 18, 19, 21, 22, 23, 24, 25, 26, 28, 29, 30, 31, 32, 33, 35, 36, 37, 38, 39, 40, 49, 50, 51, 52, 53, 54, 56, 57, 58, 59, 60, 61, 63, 64, 65, 66, 67, 68, 70, 71, 72, 73, 74, 75, 77, 78, 79, 80, 81, 82, 84, 85
Offset: 1

Views

Author

Keywords

Comments

Also the set of numbers with no "6" in their base-7 representation; see Gerver-Ramsey, also comments in A020654. - Nathaniel Johnston, Jun 27 2011
Up to the offset, identical to A037470. There are lexicographically earlier, but non-monotonic sequences which do not contain a 7-term AP, e.g., starting with 0,0,0,0,0,0,1,0,... - M. F. Hasler, Oct 05 2014

Crossrefs

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).

Programs

  • Maple
    seq(`if`(numboccur(6,convert(n,base,7))=0,n,NULL),n=0..85); # Nathaniel Johnston, Jun 27 2011
  • Mathematica
    Select[Range[0, 100], FreeQ[IntegerDigits[#, 7], 6]&] (* Jean-François Alcover, Jan 27 2023 *)
  • PARI
    a(n)=vector(#n=digits(n-1, 6), i, 7^(#n-i))*n~ \\ M. F. Hasler, Oct 05 2014
    
  • Python
    from gmpy2 import digits
    def A020657(n): return int(digits(n-1,6),7) # Chai Wah Wu, May 06 2025

Extensions

Name edited by M. F. Hasler, Oct 10 2014. Further edited by N. J. A. Sloane, Jan 04 2016

A020658 Lexicographically earliest increasing sequence of positive numbers that contains no arithmetic progression of length 7.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 8, 9, 10, 11, 12, 13, 15, 16, 17, 18, 19, 20, 22, 23, 24, 25, 26, 27, 29, 30, 31, 32, 33, 34, 36, 37, 38, 39, 40, 41, 50, 51, 52, 53, 54, 55, 57, 58, 59, 60, 61, 62, 64, 65, 66, 67, 68, 69, 71, 72, 73, 74, 75, 76, 78, 79, 80, 81, 82, 83, 85, 86, 87, 88, 89, 90, 99
Offset: 1

Views

Author

Keywords

Comments

This is different from A047304: note the gap between 41 and 50. - M. F. Hasler, Oct 07 2014

Crossrefs

Cf. A047304.
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).

Programs

  • Maple
    Noap:= proc(N,m)
    # N terms of earliest increasing seq with no m-term arithmetic progression
    local A,forbid,n,c,ds,j;
    A:= Vector(N):
    A[1..m-1]:= <($1..m-1)>:
    forbid:= {m}:
    for n from m to N do
      c:= min({$A[n-1]+1..max(max(forbid)+1, A[n-1]+1)} minus forbid);
      A[n]:= c;
      ds:= convert(map(t -> c-t, A[m-2..n-1]),set);
      for j from m-2 to 2 by -1 do
        ds:= ds intersect convert(map(t -> (c-t)/j, A[m-j-1..n-j]),set);
        if ds = {} then break fi;
      od;
      forbid:= select(`>`,forbid,c) union map(`+`,ds,c);
    od:
    convert(A,list)
    end proc:
    Noap(100, 7); # Robert Israel, Jan 04 2016
  • Mathematica
    Select[Range[0, 100], FreeQ[IntegerDigits[#, 7], 6]&] + 1 (* Jean-François Alcover, Aug 18 2023, after M. F. Hasler *)

Formula

a(n) = A020657(n)+1. - M. F. Hasler, Oct 07 2014

A020664 Lexicographically earliest increasing sequence of positive numbers that contains no arithmetic progression of length 10.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 13, 14, 15, 16, 17, 18, 20, 21, 22, 23, 24, 25, 26, 27, 28, 31, 32, 33, 34, 35, 36, 37, 38, 39, 41, 42, 43, 44, 45, 49, 50, 51, 52, 53, 54, 55, 58, 59, 60, 61, 62, 63, 64, 65, 66, 68, 69, 70, 71, 72, 73, 74, 75, 77, 78, 81, 82, 83, 84, 85, 88, 89, 96, 97
Offset: 1

Views

Author

Keywords

Crossrefs

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).

Programs

  • Maple
    Noap:= proc(N,m)
    # N terms of earliest increasing seq with no m-term arithmetic progression
    local A,forbid,n,c,ds,j;
    A:= Vector(N):
    A[1..m-1]:= <($1..m-1)>:
    forbid:= {m}:
    for n from m to N do
      c:= min({$A[n-1]+1..max(max(forbid)+1, A[n-1]+1)} minus forbid);
      A[n]:= c;
      ds:= convert(map(t -> c-t, A[m-2..n-1]),set);
      for j from m-2 to 2 by -1 do
        ds:= ds intersect convert(map(t -> (c-t)/j, A[m-j-1..n-j]),set);
        if ds = {} then break fi;
      od;
      forbid:= select(`>`,forbid,c) union map(`+`,ds,c);
    od:
    convert(A,list)
    end proc:
    Noap(100,10); # Robert Israel, Jan 04 2016

A005838 Lexicographically earliest increasing sequence of positive numbers that contains no arithmetic progression of length 6.

Original entry on oeis.org

1, 2, 3, 4, 5, 7, 8, 9, 10, 12, 13, 14, 15, 17, 18, 19, 20, 22, 23, 24, 25, 26, 33, 34, 35, 36, 37, 39, 43, 44, 45, 46, 47, 49, 50, 51, 52, 59, 60, 62, 63, 64, 65, 66, 68, 69, 71, 73, 77, 85, 87, 88, 89, 90, 91, 93, 96, 97, 98, 99, 100, 103, 104, 107, 111, 114, 115, 117, 118, 120
Offset: 1

Views

Author

Keywords

References

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

Crossrefs

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).

Programs

  • Maple
    N:= 100: # to get a(1)..a(N)
    A:= Vector(N):
    A[1..5]:= <($1..5)>:
    forbid:= {6}:
    for n from 6 to N do
      c:= min({$A[n-1]+1::max(max(forbid)+1, A[n-1]+1)} minus forbid);
      A[n]:= c;
      ds:= convert(map(t -> c-t, A[4..n-1],set);
      if ds = {} then next fi;
      ds:= ds intersect convert(map(t -> (c-t)/4, A[1..n-4]),set);
      if ds = {} then next fi;
      ds:= ds intersect convert(map(t -> (c-t)/3, A[2..n-3]),set);
      if ds = {} then next fi;
      ds:= ds intersect convert(map(t -> (c-t)/2, A[3..n-2]),set);
      forbid:= select(`>`,forbid,c) union map(`+`,ds,c);
    od:
    convert(A,list); # Robert Israel, Jan 04 2016
  • PARI
    A005838(n,show=1,i=1,o=6,u=0)={for(n=1,n,show&&print1(i,",");u+=1<M. F. Hasler, Jan 03 2016

Formula

a(n) = A020656(n) + 1.

Extensions

Name and links/references edited by M. F. Hasler, Jan 03 2016
Further edited by N. J. A. Sloane, Jan 04 2016

A020656 Lexicographically earliest increasing sequence of nonnegative numbers that contains no arithmetic progression of length 6.

Original entry on oeis.org

0, 1, 2, 3, 4, 6, 7, 8, 9, 11, 12, 13, 14, 16, 17, 18, 19, 21, 22, 23, 24, 25, 32, 33, 34, 35, 36, 38, 42, 43, 44, 45, 46, 48, 49, 50, 51, 58, 59, 61, 62, 63, 64, 65, 67, 68, 70, 72, 76, 84, 86, 87, 88, 89, 90, 92, 95, 96, 97, 98, 99, 102, 103, 106, 110, 113, 114, 116, 117, 119, 121
Offset: 1

Views

Author

Keywords

Examples

			5 is excluded since (0,1,2,3,4,5) would be a 6-term AP.
10 is excluded since (0,2,4,6,8,10) would be a 6-term AP.
Idem for 15 and 20.
25 is not excluded, but after 25 (1,6,11,16,21,26) would be a 6-AP, and similarly all of 26 through 32 are excluded.
		

Crossrefs

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).

Programs

  • PARI
    A020656(n,show=1,i=0,o=6,u=0)={for(n=1,n,show&&print1(i,",");u+=1<M. F. Hasler, Jan 03 2016

Formula

a(n) = A005838(n) - 1.

Extensions

Edited by M. F. Hasler, Jan 03 2016
Further edited (with new offset) by N. J. A. Sloane, Jan 04 2016

A020659 Lexicographically earliest increasing sequence of nonnegative numbers that contains no arithmetic progression of length 8.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 8, 9, 10, 11, 12, 13, 15, 16, 17, 18, 19, 20, 22, 23, 24, 25, 26, 27, 29, 30, 31, 32, 33, 34, 36, 37, 38, 39, 40, 41, 43, 44, 45, 46, 47, 48, 49, 58, 59, 60, 61, 62, 63, 64, 66, 68, 69, 70, 71, 73, 74, 75, 76, 77, 78, 80, 83, 84, 86, 87, 88, 90, 91, 92, 94, 95, 96, 99
Offset: 1

Views

Author

Keywords

Crossrefs

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).

A020660 Lexicographically earliest increasing sequence of positive numbers that contains no arithmetic progression of length 8.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 13, 14, 16, 17, 18, 19, 20, 21, 23, 24, 25, 26, 27, 28, 30, 31, 32, 33, 34, 35, 37, 38, 39, 40, 41, 42, 44, 45, 46, 47, 48, 49, 50, 59, 60, 61, 62, 63, 64, 65, 67, 69, 70, 71, 72, 74, 75, 76, 77, 78, 79, 81, 84, 85, 87, 88, 89, 91, 92, 93, 95, 96, 97
Offset: 1

Views

Author

Keywords

Crossrefs

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).

Programs

  • Maple
    Noap:= proc(N,m)
    # N terms of earliest increasing seq with no m-term arithmetic progression
    local A,forbid,n,c,ds,j;
    A:= Vector(N):
    A[1..m-1]:= <($1..m-1)>:
    forbid:= {m}:
    for n from m to N do
      c:= min({$A[n-1]+1..max(max(forbid)+1, A[n-1]+1)} minus forbid);
      A[n]:= c;
      ds:= convert(map(t -> c-t, A[m-2..n-1]),set);
      for j from m-2 to 2 by -1 do
        ds:= ds intersect convert(map(t -> (c-t)/j, A[m-j-1..n-j]),set);
        if ds = {} then break fi;
      od;
      forbid:= select(`>`,forbid,c) union map(`+`,ds,c);
    od:
    convert(A,list)
    end proc:
    Noap(100, 8); # Robert Israel, Jan 04 2016
Showing 1-10 of 27 results. Next