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

A362881 a(n) is the length of the longest arithmetic progression ending at a(n-1); a(1)=1.

Original entry on oeis.org

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

Views

Author

Samuel Harkness, May 07 2023

Keywords

Comments

Progressions are terms at indices which are in arithmetic progression and with values which are in arithmetic progression too.
In the first 10^6 terms, no 2's occur after a(60) and no 3's occur after a(2746). Can it be proved that no more will occur after these values? For any k in the sequence, is there a term where k occurs for the final time?
This sequence is unbounded (this is a consequence of Van der Waerden's theorem). - Rémy Sigrist, May 14 2023

Examples

			For n = 13, the longest arithmetic progression ending at a(12) is {a(4), a(8), a(12)} = {2, 3, 4}, which has length 3, so a(13) = 3.
For n = 28, the longest arithmetic progression ending at a(27) is {a(15), a(18), a(21), a(24), a(27)} = {3, 3, 3, 3, 3}, which has length 5, so a(28) = 5.
		

Crossrefs

Cf. A308638, A362909 (indices of record highs).

Programs

  • MATLAB
    See Links section.
  • Mathematica
    a[nmax_Integer] := Module[{K, r, f, d}, K = ConstantArray[0, nmax]; K[[1 ;; 2]] = {1, 1}; For[n = 3, n <= nmax, n++, r = 1; For[b = 1, b <= n - 2, b++, d = K[[n - 1 - b]] - K[[n - 1]]; f = 2; While[n - 1 - f*b > 0 && K[[n - 1 - f*b]] - K[[n - 1 - (f - 1)*b]] == d, f = f + 1;]; If[f > r, r = f];]; K[[n]] = r;]; K]; a[87] (* Robert P. P. McKone, Aug 24 2023 *)

A308639 a(n) is the number of pairs (i,j) such that 0 < i < j < n-1 and the points (i, a(i)), (j, a(j)) and (n-1, a(n-1)) are aligned.

Original entry on oeis.org

0, 0, 0, 1, 0, 3, 1, 0, 6, 3, 1, 1, 3, 1, 6, 1, 10, 0, 11, 2, 2, 2, 2, 5, 0, 15, 1, 16, 0, 21, 1, 22, 2, 7, 1, 29, 2, 11, 0, 31, 2, 16, 1, 36, 9, 0, 38, 3, 5, 2, 21, 0, 45, 4, 3, 11, 3, 12, 1, 45, 0, 56, 0, 69, 1, 56, 3, 16, 4, 5, 3, 25, 1, 69, 1, 79, 0, 82, 1
Offset: 1

Views

Author

Rémy Sigrist, Jun 13 2019

Keywords

Comments

This sequence is unbounded: by contradiction:
- if the sequence was bounded, say a(n) <= M for any n > 0, then some value, say v, would appear infinitely many times, say at indices (b(1), b(2), ...),
- hence for any k > 0, a(b(k)+1) >= (k-1)*(k-2)/2,
- and for k > 2 + sqrt(2*M), a(b(n)+1) > M , a contradiction, QED.

Examples

			The first terms, alongside the pairs (i,j) such that 0 < i < j < n-1 and the points (i, a(i)), (j, a(j)) and (n-1, a(n-1)) are aligned, are:
  n   a(n)  (i,j)'s
  --  ----  -----------------------------------
   1     0  none
   2     0  none
   3     0  none
   4     1  (1,2)
   5     0  none
   6     3  (1,2), (1,3), (2,3)
   7     1  (3,4)
   8     0  none
   9     6  (1,2), (1,3), (1,5), (2,3), (2,5), (3,5)
  10     3  (3,4), (3,6), (4,6)
  11     1  (1,4)
  12     1  (4,7)
  13     3  (4,7), (4,11), (7,11)
  14     1  (6,10)
		

Crossrefs

See A308638 for a similar sequence.

Programs

  • C
    See Links section.

A365047 a(n) is the number of three-term geometric progressions, with rational ratio > 0, formed by the terms a(n-1), a(n-1-k) and a(n-1-2*k), where k >= 1 and n - 1 - 2*k >= 0.

Original entry on oeis.org

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

Views

Author

Scott R. Shannon, Oct 21 2023

Keywords

Comments

The sequence is dominated by the count of three-term progressions consisting of three 0's. The 0 terms alternate between long runs on the even and odd n values, so the larger nonzero terms alternate between counting the progressions on these two subsequences, leading to two interrupted lines on the graph of the terms, along with the much lower counts of other three-term subsequences. See the attached image.

Examples

			a(3) = 1 and a(2) = a(1) = a(0) = 0 form a progression with ratio 1 separated by one term.
a(8) = 1 as a(7) = a(5) = a(3) = 1 for a progression with ratio 1 separated by two terms.
a(12) = 2 as a(11) = a(8) = a(5) = 1 form a progression with ratio 1 separated by three terms, while a(11) = a(7) = a(3) = 1 form a progression with ratio 1 separated by four terms.
a(20) = 2 as a(19) = 4, a(15) = 2, a(11) = 1 form a progression with ratio 1/2 separated by four terms, while a(19) = 4, a(12) = 2, a(5) = 1  form a progression with ratio 1/2 separated by seven terms.
a(170) = 1 as a(169) = 16, a(131) = 12, a(93) = 9 form a progression with ratio 3/4 separated by thirty-eight terms. This is the first series with a ratio that is not an integer or an integer reciprocal.
		

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

A366907 a(n) is the number of geometric progressions with three or more terms, with rational ratio > 0, formed by the terms a(n-1), a(n-1-k), a(n-1-2*k),...,a(n-1-t*k) where k>=1, t>=2, and n-1-t*k>=0.

Original entry on oeis.org

0, 0, 0, 1, 0, 1, 0, 2, 0, 4, 1, 0, 1, 0, 0, 2, 0, 3, 0, 3, 0, 6, 0, 7, 0, 9, 0, 13, 0, 12, 0, 15, 0, 21, 0, 20, 0, 22, 0, 30, 0, 30, 0, 31, 0, 38, 0, 39, 0, 43, 0, 47, 0, 46, 0, 53, 0, 61, 0, 57, 0, 59, 0, 69, 0, 72, 0, 72, 0, 78, 0, 79, 0, 84, 0, 91, 0, 90, 0, 96, 0, 103, 0, 98, 0, 105, 0, 116
Offset: 0

Views

Author

Scott R. Shannon, Oct 27 2023

Keywords

Comments

The sequence is dominated by the count of progressions consisting of three or more 0's. Very rarely the count of these zero-progressions forms a new progression of its own, which forms a short series of small terms and resets the subsequent count of the zero-progressions to a lower value. In the first 10^5 terms this only happens three times - at a(10) (which is not readily noticeable on the graph of the terms), a(644), and a(61434). See the attached images.

Examples

			a(3) = 1 and a(2) = a(1) = a(0) = 0 form a progression with ratio 1 separated by one term.
a(7) = 2 as a(6) = a(4) = a(2) = 0 form a three-term progression with ratio 1 separated by two terms, while a(6) = a(4) = a(2) = a(0) = 0 form a four-term progression with ratio 1 separated by two terms.
a(10) = 1 as a(9) = 4, a(7) = 2, a(5) = 1 form a three-term progression with ratio 1/2 separated by two terms.
		

Crossrefs

A359865 a(n) is the number of k > 0 such that n-1-2*k >= 0 and a(n-1-2*k) * a(n-1) = a(n-1-k)^2.

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Jan 16 2023

Keywords

Comments

In other words, a(n) gives the number of geometric progressions (a(n-1-2*k), a(n-1-k), a(n-1)) of the form (x, x*y, x*y^2) or (x*y^2, x*y, x) with x, y >= 0.
This sequence has similarities with A308638: here we count geometric progressions, there arithmetic progressions.

Examples

			The first terms, alongside the corresponding k's, are:
  n   a(n)  k's
  --  ----  ------
   0     0  {}
   1     0  {}
   2     0  {}
   3     1  {1}
   4     1  {1}
   5     1  {2}
   6     1  {1}
   7     1  {1}
   8     2  {1, 2}
   9     0  {}
  10     0  {}
  11     1  {1}
  12     2  {1, 4}
  13     0  {}
  14     2  {3, 4}
		

Crossrefs

Cf. A308638.

Programs

  • C
    See Links section.

A384450 a(1) = 0; thereafter, a(n) is the number of arithmetic progressions of length 3 or greater at indices in an arithmetic progression ending at a(n-1).

Original entry on oeis.org

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

Views

Author

Neal Gersh Tolunsky, May 27 2025

Keywords

Comments

In other words, take the longest arithmetic progression at indices with common difference k ending at a(n-1) and call that length j. a(n) is the sum of each j-2 that corresponds to a distinct common difference k. This means that an arithmetic progression of length 3 is worth 1 point, length 4 is worth 2 points, and so on.

Examples

			To find a(10), we see that there are 4 arithmetic progressions ending in a(9) = 0. These occur at indices i = 5,7,9; i = 3,5,7,9; i = 1,3,5,7,9; and i = 1,5,9. So a(10) = 4.
		

Crossrefs

Extensions

a(32)-a(86) from Pontus von Brömssen, May 30 2025
Showing 1-7 of 7 results.