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

A333211 Variation of Van Eck's sequence A181391: a(n+1) = the minimum positive offset m from a(n) such that a(n-m-1)*a(n-m) = a(n-1)*a(n); a(n+1)=0 if no such m exists. Start with a(1) = a(2) = 0.

Original entry on oeis.org

0, 0, 0, 1, 1, 0, 2, 1, 0, 2, 1, 3, 0, 3, 1, 3, 1, 1, 13, 0, 6, 1, 0, 2, 1, 14, 0, 3, 1, 12, 0, 3, 1, 4, 0, 3, 1, 4, 4, 0, 4, 1, 4, 1, 1, 27, 0, 6, 1, 27, 4, 0, 4, 1, 10, 0, 3, 1, 21, 0, 3, 1, 4, 9, 0, 4, 1, 4, 1, 1, 25, 0, 6, 1, 25, 4, 0, 4, 1, 10, 25
Offset: 1

Views

Author

Scott R. Shannon, Mar 11 2020

Keywords

Comments

After 100 million terms the smallest number not appearing is 179549, while the smallest product of adjacent terms not appearing is 2969.

Examples

			a(3) = 0 as a(1)*a(2) = 0*0 = 0, which has not previously appeared as the product of two adjacent terms.
a(4) = 1 as a(2)*a(3) = 0*0 = 0, which equals the product a(1)*a(2), one term back from a(3).
a(5) = 1 as a(3)*a(4) = 0*1 = 0, which equals the product a(2)*a(3), one term back from a(3).
a(6) = 0 as a(4)*a(5) = 1*1 = 1, which has not previously appeared as the product of two adjacent terms.
a(19) = 13 as a(17)*a(18) = 1*1 = 1, which equals the product a(4)*a(5), thirteen terms back from a(18).
		

Crossrefs

A334052 Variant of Van Eck's sequence: Set a(1) = 1, a(2) = 0, a(3) = 1. Thereafter, a(n) is the minimum positive offset i from a(n-1) such that some partial sum a(n-1-i)+...+a(n-1-i+k) = a(n-1) (0 <= k < i).

Original entry on oeis.org

1, 0, 1, 2, 3, 2, 2, 1, 5, 3, 3, 1, 4, 2, 7, 3, 5, 5, 1, 7, 5, 3, 6, 5, 3, 3, 1, 8, 4, 3, 4, 2, 18, 10, 17, 12, 8, 9, 8, 2, 8, 2, 2, 1, 17, 7, 16, 20, 5, 7, 4, 9, 14, 13, 3, 12, 7, 7, 1, 15, 3, 6, 31, 25, 5, 16, 7, 9, 7, 2, 27, 15, 12, 17, 29, 2, 6, 15, 6, 2, 4, 30, 18, 15, 6
Offset: 1

Views

Author

Ethan Goldberg, Sep 06 2020

Keywords

Comments

Conjecture: this sequence is defined. That is, each a(n-1) appears as a partial sum starting from some offset.

Examples

			For n=3 (the first term after the initial conditions), we are looking for a run that sums to a(2) = 1 (and doesn't include a(2)). The most recent such run starts at a(1) = 1, and goes for one place. So a(3) = 2, the distance from a(n-1) to the beginning of the run.
For n=4, we are looking for a run that sums to 2. The last such run is a(1) + a(2) + a(3), at a distance of 3 away. so a(4) = 3.
		

Crossrefs

Similar to A181391. Along the same lines as A333210, which looks for pairs with a particular sum. By adding a restriction that the runs have a maximum length of 1, we recover Van Eck's sequence.

Programs

  • Haskell
    findSumRun target index runLength sum (x:xs)
      | sum == target = index + runLength
      | runLength == 0 = findSumRun target index 1 x (x:xs)
      | sum > target = findSumRun target (index+1) (runLength-1) (sum-x) xs
      | sum < target = findSumRun target index (runLength+1) (sum + ((x:xs)!!(runLength))) (x:xs)
    step (x:xs) = findSumRun x 0 0 0 xs
    seq 0 xs = xs
    seq n xs = ves (n-1) ((step xs):xs)
Showing 1-2 of 2 results.