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.

Previous Showing 41-50 of 59 results. Next

A236336 Lexicographically earliest increasing sequence of positive integers whose graph has no three collinear points.

Original entry on oeis.org

1, 2, 4, 5, 9, 12, 16, 22, 26, 33, 38, 45, 53, 60, 61, 76, 86, 91, 92, 97, 111, 112, 121, 134, 135, 147, 148, 150, 153, 157, 167, 180, 200, 212, 223, 227, 228, 238, 246, 264, 269, 282, 286, 305, 312, 313, 321, 322, 327, 328, 360, 374, 389, 393, 395, 420, 421
Offset: 1

Views

Author

Tanya Khovanova, Jan 22 2014

Keywords

Comments

An increasing version of A236335.

Examples

			Consider a(5). The previous terms are 1,2,4,5. The value of a(5) can't be 6 because points (3,4),(4,5),(5,6) (corresponding to values a(3),a(4),a(5)) are on the same line: y=x+1. Points (1,1),(3,4),(5,7) are on the same line y=3x/2-1/2, so a(5) can't be 7. Points (2,2),(3,4),(5,8) are on the same line: y=2x-2, so a(5) can't be 8. Thus a(5)=5.
		

Crossrefs

Programs

  • Maple
    a:= proc(n) option remember; local i, j, k, ok;
          if n<3 then n
        else for k from 1+a(n-1) do ok:=true;
               for j from n-1 to 2 by -1 while ok do
                 for i from j-1 to 1 by -1 while ok do
                   ok:= (n-j)*(a(j)-a(i))<>(j-i)*(k-a(j)) od
               od; if ok then return k fi
             od
          fi
        end:
    seq(a(n), n=1..70);  # Alois P. Heinz, Jan 23 2014
  • Mathematica
    g[1] = 1;
    g[n_] := g[n] =
      Min[Complement[Range[g[n - 1] + 1, 500],
        Select[Flatten[
          Table[g[k] + (n - k) (g[j] - g[k])/(j - k), {k, n - 2}, {j,
            k + 1, n - 1}]], IntegerQ[#] &]]]
    Table[g[k], {k, 50}]

A248639 Least nonnegative sequence which does not contain a 4-term equidistant subsequence (a(n+k*d); k=0,1,2,3) in arithmetic progression.

Original entry on oeis.org

0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 2, 0, 0, 0, 1, 0, 1, 1, 1, 2, 2, 2, 0, 0, 2, 0, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 2, 2, 1, 2, 1, 2, 2, 4, 0, 0, 0, 2, 0, 0, 2, 0, 0, 0, 1, 1, 1, 2, 0, 1, 0, 0, 0, 1, 1, 1, 2, 3, 1, 2, 1, 1, 1, 2, 2, 0, 2, 2, 2, 4, 4, 3, 0, 0, 0, 2, 0, 1, 2, 0, 4, 2, 1, 5, 0, 2, 1, 1, 2, 1, 0, 0, 2, 2, 0, 0, 0, 3, 0, 0, 1, 1, 1, 4, 1, 2, 3, 0, 1, 2, 1, 0, 3, 3, 4, 1, 1, 3
Offset: 0

Views

Author

M. F. Hasler, Oct 10 2014

Keywords

Comments

See A248625 for more information, links and examples.
See A248641 for the "positive integers" variant.

Crossrefs

Programs

  • PARI
    a=[];for(n=1,190,a=concat(a,0);while(hasAP(a,4),a[#a]++));a \\ See A248625 for hasAP().

A248640 Least nonnegative sequence which does not contain a 5-term equidistant subsequence (a(n+k*d); k=0,1,2,3,4) in arithmetic progression.

Original entry on oeis.org

0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0
Offset: 0

Views

Author

M. F. Hasler, Oct 10 2014

Keywords

Comments

See A248625 for more information, links and examples.

Crossrefs

Programs

  • PARI
    a=[];for(n=1,190,a=concat(a,0);while(hasAP(a,5),a[#a]++));a \\ See A248625 for hasAP(). Use concat(a,1) for the "positive integer" variant.

A262942 Sequence of positive integers where each is chosen to be as small as possible subject to the conditions that no three terms a(j), a(j+k), a(j+2*k) (for any j and k) form an arithmetic progression (in any order) and that no term repeats.

Original entry on oeis.org

1, 2, 4, 5, 8, 3, 7, 6, 10, 11, 14, 9, 16, 12, 13, 19, 15, 18, 20, 21, 26, 17, 22, 24, 25, 27, 31, 28, 23, 32, 29, 34, 37, 38, 40, 41, 35, 30, 42, 46, 47, 54, 36, 33, 45, 43, 49, 39, 48, 50, 55, 52, 53, 44, 59, 57, 51, 60, 56, 61, 62, 67, 58, 69, 64, 72, 66, 68, 76, 71, 73, 77, 65, 75, 63, 88, 89, 80, 78, 74, 83, 79, 70, 90, 94, 82, 81, 84, 85, 91, 87, 101
Offset: 1

Views

Author

Max Barrentine, Oct 05 2015

Keywords

Comments

Conjectured permutation of the natural numbers.

Examples

			For n = 4, 3 is not available because {a(2)=2, 3, a(3)=4} form an arithmetic progression, 1,2,4 are already used, so a(4) = 5. - _Robert Israel_, Nov 15 2015
		

Crossrefs

A229037 has a very similar definition, but a totally different graph.

Programs

  • Maple
    N:= 1000: # to get all terms before the first > N
    V:= Vector(N):
    S:= Vector(N):
    firstav:= 1;
    for n from 1 to N do
        forbid:= {seq(op([2*V[k]-V[2*k-n], 2*V[2*k-n]-V[k],(V[k]+V[2*k-n])/2]),k=ceil((n+1)/2)..n-1)};
        for v from firstav to N do
          if S[v] <> 0 and v = firstav then firstav:= v+1 fi;
          if S[v] = 0 and not member(v, forbid) then
            V[n]:= v;
            S[v]:= 1;
            break
          fi
        od;
        if v > N then break fi;
    od:
    seq(V[i],i=1..n-1); # Robert Israel, Nov 15 2015

Extensions

Added more terms from b-file. - N. J. A. Sloane, Nov 26 2015

A293862 Sequence of signed integers where each is chosen to be as small as possible (in absolute value) 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; in case of a tie, preference is given to the positive value.

Original entry on oeis.org

0, 0, 1, 0, 0, 1, 1, -1, -1, 0, 0, -1, 0, 0, 1, 3, 3, -1, 3, 3, 1, 1, 2, 2, 1, -3, 2, 0, 0, -2, 0, 0, 1, -3, -3, -2, 0, 0, 4, 0, 0, 1, -2, -1, -1, -2, 5, -1, 3, -3, 2, 3, 3, 2, 5, 4, 4, 2, 4, 2, 3, -1, -1, 3, -8, -2, 5, 2, -2, -2, -8, -3, -2, -8, -6, -6, 2, 5
Offset: 1

Views

Author

Rémy Sigrist, Oct 18 2017

Keywords

Comments

This sequence is a "signed" variant of A229037. Graphically, both sequences have similar ethereal features.
For any n > 0, |a(n)| <= floor( (n+1)/4 ).

Examples

			a(1) = 0 is suitable.
a(2) = 0 is suitable.
a(3) cannot equal 0 as 2*a(3-1) - a(3-2) = 0.
a(3) = 1 is suitable.
a(4) cannot equal 2 as 2*a(4-1) - a(4-2) = 2.
a(4) = 0 is suitable.
a(5) cannot equal -1 as 2*a(5-1) - a(5-2) = -1.
a(5) cannot equal 2 as 2*a(5-2) - a(5-4) = 2.
a(5) = 0 is suitable.
a(6) cannot equal 0 as 2*a(6-1) - a(6-2) = 0.
a(6) = 1 is suitable.
a(7) cannot equal 2 as 2*a(7-1) - a(7-2) = 2.
a(7) cannot equal -1 as 2*a(7-2) - a(7-4) = -1.
a(7) cannot equal 0 as 2*a(7-3) - a(7-6) = 0.
a(7) = 1 is suitable.
a(8) cannot equal 1 as 2*a(8-1) - a(8-2) = 1.
a(8) cannot equal 2 as 2*a(8-2) - a(8-4) = 2.
a(8) cannot equal 0 as 2*a(8-3) - a(8-6) = 0.
a(8) = -1 is suitable.
		

A333835 Lexicographically earliest sequence of distinct positive integers, which when mapped onto a square spiral, gives a set without three distinct evenly spaced aligned points.

Original entry on oeis.org

1, 2, 3, 4, 17, 18, 20, 21, 22, 24, 27, 28, 31, 33, 34, 61, 80, 81, 87, 90, 93, 100, 131, 135, 145, 146, 148, 152, 154, 157, 158, 160, 166, 171, 172, 174, 189, 194, 225, 253, 268, 270, 271, 276, 281, 282, 291, 294, 295, 298, 316, 335, 338, 368, 383, 397, 405
Offset: 1

Views

Author

Rémy Sigrist, Apr 07 2020

Keywords

Comments

This sequence has similarities with A005836 and A229037.

Examples

			The first terms, mapped onto a square spiral, are:
         *---*---*---*--61---*---*---*---*
         |                               |
         *   *---*---*--34--33---*--31   *
         |   |                       |   |
         *   *  17---*---*---*---*   *   *
         |   |   |               |   |   |
         *   *  18   *---4---3   *   *   *
         |   |   |   |       |   |   |   |
         *   *   *   *   1---2   *  28   *
         |   |   |   |           |   |   |
         *   *  20   *---*---*---*  27   *
         |   |   |                   |   |
         *   *  21--22---*--24---*---*   *
         |   |                           |
         *   *---*---*---*---*---*---*---*
         |
         *---*---*---*---*---*---*--80--81
		

Crossrefs

See A333825 for a similar sequences.

A357256 "Forest Fire" sequence with the additional condition that no progression of the form ABA is allowed for any terms A and B.

Original entry on oeis.org

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

Views

Author

Neal Gersh Tolunsky, Dec 11 2022

Keywords

Comments

It is easy to see that a number can occur no more than twice: 1) If a number occurs twice, one term with that value must be at an odd n and the other at an even n. This is because otherwise you could always find a progression of the form ABA. 2) Once two terms of the same value are in the sequence on an even and odd n, no third term with that value can be added without creating a progression of form ABA.

Examples

			a(4)=2 because if a(4) were 1 the 2-4th terms would be the ABA-form progression 1,2,1. 2 here is the smallest number which forms neither an arithmetic nor ABA progression.
		

Crossrefs

Cf. A229037.

Programs

  • Python
    from itertools import count, islice
    def agen(): # generator of terms
        alst, mink, aba = [0], [1, 1], [set(), set()] # even, odd appearances
        for n in count(1):
            k = mink[n&1]
            ff = set(2*alst[n-i] - alst[n-2*i] for i in range(1, (n+1)//2))
            while k in ff or k in aba[n&1]: k += 1
            alst.append(k); aba[n&1].add(k); yield k
            while mink[n&1] in aba[n&1]: mink[n&1] += 1
    print(list(islice(agen(), 70))) # Michael S. Branicky, Dec 12 2022

Extensions

More terms from Michael S. Branicky, Dec 12 2022

A361702 Lexicographically earliest sequence of positive numbers on a square spiral such that no four equal numbers lie on the circumference of a circle.

Original entry on oeis.org

1, 1, 1, 2, 1, 2, 1, 2, 2, 2, 1, 3, 3, 1, 3, 3, 3, 2, 2, 3, 2, 4, 4, 4, 2, 1, 2, 3, 4, 3, 4, 4, 5, 5, 5, 5, 1, 1, 5, 4, 3, 4, 6, 5, 6, 6, 4, 3, 2, 1, 5, 4, 1, 6, 3, 4, 2, 5, 6, 5, 6, 7, 6, 7, 3, 1, 5, 7, 7, 6, 4, 6, 5, 7, 6, 4, 7, 8, 7, 6, 7, 4, 7, 5, 8, 8, 8, 6, 3, 6, 4, 8, 5, 8, 9, 9, 7, 8, 3
Offset: 1

Views

Author

Scott R. Shannon, Mar 21 2023

Keywords

Comments

The first term a(1) = 1 lies at the (0,0) origin while all other terms lie on integer coordinates.

Examples

			a(4) = 2 as a(1) = a(2) = a(3) = 1 all lie on the circumference of a circle with radius 1/sqrt(2) centered at (1/2,1/2), assuming a counter-clockwise spiral, so a(4) cannot be 1.
a(12) = 3 as a(2) = a(3) = a(11) = 1 all lie on the circumference of a circle with radius 1/sqrt(2) centered at (3/2,1/2), so a(12) cannot be 1, while a(4) = a(8) = a(10) = 2 all lie on the circumference of a circle with radius sqrt(2) centered at (1,0), so a(12) cannot be 2.
a(22) = 4 as a(1) = a(2) = a(7) = 1 all lie on the circumference of a circle with radius sqrt(10)/2 centered at (1/2,-3/2), so a(22) cannot be 1, a(6) = a(19) = a(21) = 2 all lie on the circumference of a circle with radius sqrt(5)/2 centered at (-3/2,-1), so a(22) cannot be 2, while a(12) = a(16) = a(20) = 3 all lie on the circumference of a circle with radius sqrt(5) centered at (0,0), so a(22) cannot be 3.
		

Crossrefs

A366574 a(1) = 1; for n > 1, a(n) is the maximum positive k such that all terms a(t), a(t-m), a(t-2*m), ..., a(t-(k-1)*m), for 0=1, are equal.

Original entry on oeis.org

1, 1, 2, 1, 2, 2, 2, 3, 1, 2, 3, 2, 3, 2, 3, 3, 3, 4, 1, 2, 3, 4, 2, 3, 4, 2, 3, 4, 3, 4, 3, 4, 3, 4, 4, 4, 5, 1, 2, 3, 4, 5, 2, 3, 4, 5, 2, 3, 4, 5, 3, 4, 5, 3, 4, 5, 3, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 5, 5, 6, 1, 2, 3, 4, 5, 6, 2, 3, 4, 5, 6, 2, 3, 4, 5, 6, 3, 4, 5, 6, 3, 4, 5, 6, 3, 4, 5, 6, 4
Offset: 1

Views

Author

Scott R. Shannon, Oct 13 2023

Keywords

Comments

The terms form quickly form a repetitive pattern of arithmetic progressions of increasing length, see the graph. This leads to any given value t eventually being in a progression of length t+1 which then never increases.
See A366724 for the index where a number first appears.

Examples

			a(3) = 2 as a(2) = 1 and a(2) = a(1) = 1.
a(11) = 3 as a(10) = 2 and a(7) = a(6) = a(5) = 2.
a(18) = 4 as a(17) = 3 and a(17) = a(15) = a(13) = a(11) = 3.
		

Crossrefs

A367196 Lexicographically earliest sequence such that for any distinct j, k, m that are the side lengths of a triangle, a(j), a(k), and a(m) are not the side lengths of a triangle.

Original entry on oeis.org

1, 1, 1, 2, 1, 3, 5, 1, 8, 13, 21, 2, 34, 55, 89, 1, 144, 233, 4, 377, 610, 987, 1597, 1, 17, 2584, 4181, 6765, 10946, 17711, 3, 72, 28657, 46368, 75025, 121393, 196418, 317811, 514229, 1, 7, 305, 832040, 1346269, 2178309, 3524578, 41, 5702887, 1292, 9227465
Offset: 1

Views

Author

Neal Gersh Tolunsky, Nov 09 2023

Keywords

Comments

In a triangle, the sum of any two side lengths is greater than that of the third, so that x + y > z. The empty triangle (or line) is not counted, which means that x + y cannot be equal to z. In practice, if we have two side lengths x and y, we can find their sum s and their difference d, which tells us that side z must fall in the range d < z < s to form a triangle.
For n>0, A002620(n+1) gives the number of combinations of three indices whose corresponding terms cannot be the side lengths of a triangle in this sequence.
It appears that the local maxima are the Fibonacci numbers A000045 (except for 1s).
The second-largest values in the log graph, falling roughly on a line, appear to be A001076 (half of the even Fibonacci numbers).
Generalizing the sequence to prohibit the side lengths of any n-gon at distinct n-gonal indices gives A011782.

Examples

			a(3)=1 because the indices 1,2,3 could not be the side lengths of a triangle, so there is no restriction and the smallest number is chosen.
a(7) cannot be 1 because a(3)=1, a(5)=1, and a(7)=1 could be the side lengths of a triangle at indices which are also side lengths of a triangle.
a(7) cannot be 2 because a(4)=2, a(6)=3, and a(7)=2 are side lengths of a triangle at indices that forbid it.
a(7) cannot be 3 because a(5)=1, a(6)=3, and a(7)=3 also make a triangle at indices that forbid it.
a(7) cannot be 4 because a(4)=2, a(6)=3 and a(7)=4 form a triangle at unsuitable indices.
a(7) can be 5 without contradiction, so a(7)=5.
		

Crossrefs

Cf. A316841, A070080 (triangle side lengths).

Programs

  • MATLAB
    See Links.

Extensions

a(11)-a(50) from Samuel Harkness, Nov 13 2023
Previous Showing 41-50 of 59 results. Next