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 31-40 of 59 results. Next

A285491 Lexicographically earliest sequence of positive integers such that no two distinct unordered pairs of points ((n, a(n)), (m, a(m))) and ((k, a(k)), (j, a(j))) have the same midpoint.

Original entry on oeis.org

1, 1, 2, 1, 4, 6, 2, 9, 1, 13, 8, 19, 2, 15, 12, 28, 32, 6, 4, 18, 43, 1, 51, 16, 36, 41, 28, 34, 2, 57, 66, 10, 80, 5, 31, 24, 61, 71, 89, 12, 107, 128, 18, 99, 42, 1, 123, 142, 10, 38, 78, 164, 120, 21, 1, 58, 183, 169, 99, 93, 203, 22, 200, 155, 7, 130, 228
Offset: 1

Views

Author

Peter Kagey, Apr 19 2017

Keywords

Comments

No three terms a(j), a(j+k), a(j+2k) (for any j and k) form an arithmetic progression.

Examples

			For n = 3:
a(3) != 1 or else midpoint((1, 1), (3, 1)) = midpoint((2, 1), (2, 1)), so
a(3) = 2.
For n = 5:
a(5) != 1 or else midpoint((1, 1), (5, 1)) = midpoint((2, 1), (4, 1));
a(5) != 2 or else midpoint((2, 1), (5, 2)) = midpoint((3, 2), (4, 1));
a(5) != 3 or else midpoint((1, 1), (5, 3)) = midpoint((3, 2), (3, 2)); so
a(5) = 4.
		

Crossrefs

A330267 Lexicographically earliest sequence of nonnegative terms such that for any n > 0 and k > 0, a(n+2*k) <> max(a(n), a(n+k)).

Original entry on oeis.org

0, 0, 1, 0, 0, 1, 2, 3, 4, 0, 0, 1, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 2, 3, 10, 11, 0, 0, 1, 0, 0, 1, 12, 13, 4, 0, 0, 1, 0, 0, 1, 6, 5, 4, 7, 8, 9, 14, 15, 6, 16, 10, 5, 17, 11, 10, 7, 8, 3, 2, 5, 2, 3, 18, 19, 20, 21, 3, 2, 12, 2, 3, 13, 22, 2, 11, 2, 10, 23
Offset: 1

Views

Author

Rémy Sigrist, Dec 21 2019

Keywords

Crossrefs

Cf. A003278 (positions of 0's).
See A229037, A268811, A276204, A309890, A317805, A361933, A364057 for similar sequences.
See A330622, A330623 and A330629 for other variants.

Programs

  • C
    See Links section.

Formula

a(n) = 0 iff n belongs to A003278.

A371457 Lexicographically earliest sequence of positive integers such that no three terms a(j), a(j+k), a(j+2k) (for any j and k) form a progression of the form p, p-q, p+q, where q >= 0.

Original entry on oeis.org

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

Views

Author

Neal Gersh Tolunsky, Jun 01 2024

Keywords

Comments

This sequence avoids one of the six permutations of a set of three integers in arithmetic progression. For example, the set {1,2,3} can be ordered as tuples (1, 2, 3), (1, 3, 2), (2, 1, 3), (2, 3, 1), (3, 1, 2), and (3, 2, 1). In this sequence, we avoid (2,1,3) and other progressions of the form p, p-q, p+q, for all q >= 0.

Crossrefs

Formula

a(n)=1 iff n in A003278.

A242921 Lexicographically least increasing sequence avoiding double 3-term arithmetic progressions.

Original entry on oeis.org

0, 1, 3, 4, 7, 8, 10, 11, 15, 17, 18, 20, 25, 27, 28, 31, 32, 34, 35, 38, 42, 43, 45, 46, 53, 55, 58, 59, 61, 62, 67, 68, 70, 71, 79, 81, 85, 87, 90, 92, 93, 98, 102, 105, 112, 114, 115, 119, 121, 126, 129, 130, 132, 133, 136, 140, 141, 143, 144, 148
Offset: 0

Views

Author

Jeffrey Shallit, May 26 2014

Keywords

Comments

a(0) = 0, a(1) = 1, and for n >= 2, a(n) is the least integer t > a(n-1) such that for all 0 < i <= n/2 we have a(n-2i)+t <> 2a(n-i).
By double arithmetic sequence it is meant that both the indices and the values are in arithmetic progression.

Examples

			a(8) = 15: 12 is not in the sequence because a(6) = 10, a(7) = 11; 13 is not in the sequence because a(4) = 7, a(6) = 10; 14 is not in the sequence because a(0) = 0, a(4) = 7, so a(8) = 15.
		

Crossrefs

Differs from A094870 in that sequence must be increasing.

Programs

  • Maple
    a:= proc(n) option remember; local i, t, ok;
          if n<2 then n
        else for t from 1+a(n-1) do ok:=true;
               for i to n/2 while ok
                 do ok:=a(n-2*i)+t <> 2*a(n-i) od;
               if ok then return t fi
             od
          fi
        end:
    seq(a(n), n=0..100);  # Alois P. Heinz, May 26 2014
  • Mathematica
    a[n_] := a[n] = Module[{i, t, ok}, If[n<2, n, For[t = 1+a[n-1], True, t++, ok = True; i = 1; While[ok && i <= n/2, ok = a[n-2*i]+t != 2*a[n-i]; i++]; If[ok, Return[t]]]]];
    Table[a[n], {n, 0, 100}] (* Jean-François Alcover, Nov 09 2017, after Alois P. Heinz *)

A248641 Lexicographically earliest positive 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

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

Views

Author

M. F. Hasler, Oct 10 2014

Keywords

Comments

See A248625 for more information, links and examples.
It is a variation of A229037 where 3-term is replaced by 4-term (and with “lead index” 0 instead of 1)

Crossrefs

Programs

  • PARI
    a=[];for(n=1,190,a=concat(a,1);while(hasAP(a,4),a[#a]++));a \\ See A248625 for hasAP().
    
  • SageMath
    cpdef FourFree(int n):
       cdef int i, r, k, s, L1, L2, L3
       cdef list L, Lb
       cdef set b
       L=[1, 1, 1]
       for k in range(3, n):
          b=set()
          for i in range(k):
             if 3*((k-i)/3)==k-i:
                r=(k-i)/3
                L1, L2, L3=L[i], L[i+r], L[i+2*r]
                s=3*(L2-L1)+L1
                if s>0 and L3==2*(L2-L1)+L1:
                   b.add(s)
          if 1 not in b:
             L.append(1)
          else:
             Lb=list(b)
             Lb.sort()
             for t in Lb:
                if t+1 not in b:
                   L.append(t+1)
                   break
       return L
    # Sébastien Palcoux, Aug 28 2019

A268811 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 a geometric progression.

Original entry on oeis.org

1, 1, 2, 1, 1, 2, 2, 3, 3, 1, 1, 2, 1, 1, 2, 2, 3, 3, 2, 3, 3, 5, 5, 6, 5, 5, 6, 1, 1, 2, 1, 1, 2, 2, 3, 3, 1, 1, 2, 1, 1, 2, 2, 3, 3, 2, 3, 3, 5, 5, 6, 5, 5, 6, 2, 3, 3, 5, 5, 6, 5, 5, 6, 6, 7, 7, 6, 7, 7, 8, 8, 10, 6, 7, 7, 6, 7, 7, 8, 8, 10, 1, 1, 2, 1, 1, 2, 2, 3, 3, 1, 1, 2, 1, 1, 2, 2, 3, 3, 2, 3, 3, 5, 5, 6, 5, 5, 6, 1, 1, 2, 1, 1, 2, 2, 3, 3, 1, 1, 2, 1, 1, 2, 2, 3, 3, 2
Offset: 1

Views

Author

Aaron David Fairbanks, Feb 13 2016

Keywords

Comments

Apparently: all terms belong to A000452, and for any k > 0, the value A000452(k) first appears at index A265316(k+1). - Rémy Sigrist, May 13 2021

Crossrefs

Programs

  • C
    // See Links section.
  • Python
    A268811_list = []
    for n in range(1000):
        i, j, b = 1, 1, set()
        while n-2*i >= 0:
            b.add(A268811_list[n-i]**2/A268811_list[n-2*i])
            i += 1
            while j in b:
                b.remove(j)
                j += 1
        A268811_list.append(j)
    

A361486 Lexicographically earliest sequence of positive numbers on a square spiral such that no three equal numbers are collinear.

Original entry on oeis.org

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

Views

Author

Scott R. Shannon, Mar 13 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(5) = 2 as a(3) = 1 and a(4) = 1 lie on the horizontal line y = 1 relative to the starting square (assuming a counter-clockwise spiral) so a(5) cannot be 1.
a(7) = 3 as a(5) = 2 and a(6) = 2 lie on the vertical line x = -1 so a(7) cannot be 2, while a(1) = 1 and a(3) = 1 lie on the line y = x so a(7) cannot be 1.
a(21) = 4 as a(18) = 3 and a(19) = 3 lie on the line x = -2, a(6) = 2 and a(15) = 2 lie on the line y = 2*x + 2, while a(1) = 1 and a(3) = 1 lie on the line y = x, so a(21) cannot be 1, 2 or 3.
		

Crossrefs

A368795 Lexicographically earliest sequence of nonnegative integers such that the doubly-infinite symmetric sequence b defined by b(n) = b(-n) = a(n) for any n >= 0 has no three equidistant terms in arithmetic progression.

Original entry on oeis.org

0, 1, 1, 2, 4, 2, 2, 1, 1, 4, 2, 4, 5, 5, 9, 3, 3, 5, 5, 10, 5, 4, 7, 3, 2, 8, 6, 2, 4, 2, 4, 7, 2, 3, 6, 5, 11, 1, 7, 15, 9, 6, 12, 10, 13, 10, 2, 13, 11, 8, 17, 9, 10, 13, 14, 1, 10, 11, 17, 15, 12, 1, 1, 5, 12, 11, 5, 6, 1, 17, 3, 15, 6, 6, 7, 6, 6, 17, 25
Offset: 0

Views

Author

Rémy Sigrist, Jan 06 2024

Keywords

Comments

This sequence is a variant of A229037 and A248625 with similar graphical features.

Examples

			For n = 4:
- the first 4 terms of the sequence are: 0, 1, 1, 2,
- a(4) cannot equal 0 due to the progression b(-4) = 0, b(0) = 0, b(4) = 0,
- a(4) cannot equal 1 due to the progression b(-2) = 1, b(1) = 1, b(4) = 1,
- a(4) cannot equal 2 due to the progression b(0) = 0, b(2) = 1, b(4) = 2,
- a(4) cannot equal 3 due to the progression b(2) = 1, b(3) = 2, b(4) = 3,
- we chose a(4) = 4 as this does not induce arithmetic progressions.
		

Crossrefs

A381658 Lexicographically earliest sequence of positive integers such that for each distinct positive integer t there is only one value of k such that t = a(n) = a(n+k) = a(n+2*k).

Original entry on oeis.org

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

Views

Author

Scott R. Shannon, Mar 03 2025

Keywords

Comments

In the first 2.5 million terms the only numbers to appear in three consecutive terms are 1 (at n = 1), 2 (at n = 8), 5 (at n = 11), 7 (at n = 93), 8 (at n = 169), and 112 (at n = 96610). It is unknown if more such numbers exist.
It is conjectured that the values of n for which a(n) = 1 is given by A092482.
See A381660 for the single value of k for each distinct positive integer, and A381659 for the index where each such integer first appears.

Examples

			a(1) = a(2) = a(3) = 1. As 1 has now appeared in three terms satisfying a(n) = a(n+k) = a(n+2*k) = 1, with k = 1 in this instance, no other three terms equalling 1 can appear anywhere in the sequence that would satisfy a similar relationship.
a(4) = a(5) = 2 as choosing 1 would create another three terms equalling 1 separated by 1, and three terms equalling 1 separated by 2, namely a(1), a(3), a(5). As neither of those is permitted, the next smallest number 2 is chosen.
a(6) = 1 as this does not create any three terms equalling 1 separated by any value k, so 1 is again chosen.
a(10) = 2 as choosing 1 would create three terms a(2) = a(6) = a(10) = 1 with a difference of 4 which is not permitted. Note that a(9) = a(10) = a(11) = 2, so no other three terms equalling 2 can appear anywhere in the sequence that would satisfy a(n) = a(n+k) = a(n+2*k) = 2.
a(11) = 3 as choosing 1 would create three terms a(3) = a(7) = a(11) = 1 with a difference of 4, while choosing 2 would create a(9) = a(10) = a(11) = 2 with a difference of 1. As neither is permitted the next smallest number 3 is chosen.
		

Crossrefs

Cf. A381659 (index of first appearance), A381660 (k values), A092482 (indices of 1's), A381597, A229037.

A381660 The value k such that n = a(j) = a(j+k) = a(j+2*k) in A381658.

Original entry on oeis.org

1, 1, 1, 3, 15, 2, 1, 1, 3, 9, 43, 26, 28, 15, 4, 36, 18, 25, 6, 25, 31, 20, 70, 46, 26, 352, 114, 11, 19, 23, 49, 56, 70, 15, 56, 79, 46, 409, 29, 48, 24, 48, 52, 16, 77, 11, 123, 16, 78, 73, 48, 44, 49, 31, 11, 178, 330, 305, 180, 454, 147, 45, 158, 280, 108, 296, 53, 13, 22, 4, 184, 145, 99, 86, 114, 6, 42, 41, 248, 76, 570, 54, 204, 25, 125, 522, 110
Offset: 1

Views

Author

Scott R. Shannon, Mar 04 2025

Keywords

Comments

The last known term that equals 1 is a(112). See A381658.

Crossrefs

Previous Showing 31-40 of 59 results. Next