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

A364036 a(0) = 0, a(1) = 0; for n > 1, a(n) is the number of pairs of consecutive terms prior to a(n-1) that sum to the same value as a(n-2) + a(n-1).

Original entry on oeis.org

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

Views

Author

Scott R. Shannon, Jul 02 2023

Keywords

Comments

The same number cannot occur four times in a row as the second pair in a triplet of the same numbers increments the appearance count of the first pair by one, so the fourth number is always one more than the previous three numbers.
The occurrences of three consecutive equal numbers is quite rare, only occurring thirteen times in the first 20 million terms. The last such triplet is a(3620001) = a(3620002) = a(3620003) = 1159. It is likely such triplets occur infinitely often although this is unknown.

Examples

			a(2) = 0 as there are no previous pairs prior to a(1).
a(3) = 1 as a(1) + a(2) = 0 + 0 = 0, and there has been one previous pair that also sums to 0, namely a(0) + a(1).
a(6) = 2 as a(4) + a(5) = 0 + 1 = 1, and there has been two previous pairs that also sums to 1, namely a(2) + a(3) and a(3) + a(4).
		

Crossrefs

Cf. A364027 (include previous pair), A342585, A347062.

Programs

A373902 a(1) = 2; for n > 1, a(n) is the smallest positive number that does not equal a(n-1), shares a factor with a(n-1), and has not appeared as an adjacent term to a(n-1) previously in the sequence.

Original entry on oeis.org

2, 4, 6, 2, 8, 4, 10, 2, 12, 3, 6, 8, 10, 5, 15, 3, 9, 6, 10, 12, 4, 14, 2, 16, 4, 18, 2, 20, 4, 22, 2, 24, 3, 18, 6, 12, 8, 14, 6, 15, 9, 12, 14, 7, 21, 3, 27, 6, 16, 8, 18, 9, 21, 6, 20, 5, 25, 10, 14, 16, 10, 15, 12, 16, 18, 10, 20, 8, 22, 6, 24, 4, 26, 2, 28, 4, 30, 2, 32, 4, 34, 2, 36, 3
Offset: 1

Views

Author

Scott R. Shannon, Jun 22 2024

Keywords

Comments

See A371618 for the indices where the primes first appear.

Examples

			a(7) = 10 as a(6) = 4 and, although 2 and 6 share factors with 4, 2 and 4 form a previous adjacent pair, as do 4 and 6. This leaves 10 as the smallest number that shares a factor with 4 while 4 and 10 have not previously appeared as adjacent terms.
		

Crossrefs

Programs

  • Mathematica
    nn = 120; c[_] := {}; a[1] = j = 2; c[2] = {2};
    Do[If[PrimePowerQ[j],
      (k = 1;
         While[Or[j == #  k, CoprimeQ[j, #  k], ! FreeQ[c[j], #  k]], k++];
         k *= #) &[FactorInteger[j][[1, 1]]],
       k = FactorInteger[j][[1, 1]];
         While[Or[j == k, CoprimeQ[j, k], ! FreeQ[c[j], k]], k++] ];
      Set[{a[n], c[j], c[k], j},
          {k, Union[c[j], {k}], Union[c[k], {j}], k}], {n, 2, nn}];
    Array[a, nn] (* Michael De Vlieger, Jun 22 2024 *)
  • Python
    from math import gcd
    from itertools import count, islice
    def agen(): # generator of terms
        an, adjacent = 2, {2: set()}
        while True:
            yield an
            A = adjacent[an]
            m = next(k for k in count(2) if k!=an and gcd(k, an)>1 and k not in A)
            adjacent[an].add(m)
            if m not in adjacent: adjacent[m] = set()
            adjacent[m].add(an)
            an = m
    print(list(islice(agen(), 84))) # Michael S. Branicky, Jun 22 2024

A362947 a(0) = 0, a(1) = 0; for n > 1, a(n) is the number of pairs of consecutive terms whose product has same value as a(n-2) * a(n-1).

Original entry on oeis.org

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

Views

Author

Scott R. Shannon, Jul 05 2023

Keywords

Comments

Similarly to A364027 the same number cannot occur four times in a row. In the first 10 million terms three consecutive equal numbers occurs twenty-three times, the last such triplet being a(8247993)..a(8247995) = 59. It is likely such triplets occur infinitely often although this is unknown.

Examples

			a(2) = 1 as there is one pair whose product equals a(0) * a(1) = 0, namely a(0) * a(1).
a(3) = 2 as a(1) * a(2) = 0 * 1 = 0, and there has been two previous pairs whose product is 0, namely a(0) * a(1) and a(1) * a(2).
a(11) = 4 as a(9) * a(10) = 1 * 2 = 2, and there has been four previous pairs whose product is 2, namely a(2) * a(3), a(3) * a(4), a(4) * a(5) and a(9) * a(10).
		

Crossrefs

Showing 1-3 of 3 results.