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

A361172 a(n) is the smallest positive number not among the terms between a(n-1) and the previous most recent occurrence of a(n-1) inclusive; if a(n-1) is a first occurrence, set a(n)=1; a(1)=1.

Original entry on oeis.org

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

Views

Author

Neal Gersh Tolunsky, Mar 02 2023

Keywords

Comments

The terms between two adjacent 1s must be strictly increasing.
The index of first occurrences appears to be A060432 (partial sums of A002024).

Examples

			a(11)=5 because between a(10)=3 and the previous 3 (3, 1, 2, 4, 1, 3), the smallest missing number is 5, so a(11)=5.
		

Crossrefs

Programs

  • PARI
    { pos = [0]; v = 1; for (n = 1, #a = vector(86), print1 (a[n] = v", "); v = 1; if (a[n] <= #pos && pos[a[n]], r = Set(a[pos[a[n]]..n]); while (setsearch(r, v), v++)); while (#pos < a[n], pos = concat(pos, vector(#pos));); pos[a[n]] = n;); } \\ Rémy Sigrist, Mar 04 2023

A361101 a(n) is the smallest positive number not among the terms in a(1..n-1) with index a(n-1)*k for any integer k; a(1)=1.

Original entry on oeis.org

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

Views

Author

Neal Gersh Tolunsky, Mar 02 2023

Keywords

Comments

From Samuel Harkness, Mar 02 2023: (Start)
This sequence is partly defined by the following cases for a(353) onwards. But what is the pattern to the 1s and 2s?
For k >= 0:
a(353+4k) = 1 or 2;
a(354+2k) = (354+2k)/2 - 63;
a(355+4k) = 1.
Of the 14912 n equal to 1 (mod 4) between 352 and 60000, 4983 (33.416%) equal 1 and 9929 (66.584%) equal 2. From observation it appears that 1/3 of a(353+4k); k>=0 equal 1 and 2/3 equal 2 (see Figure).
(End)

Examples

			To find a(13), we look at the last term in the sequence thus far: (1, 2, 1, 3, 2, 1, 4, 1, 5, 1, 6, 2). Since it is a 2, the next term will be the smallest not among the even-indexed terms of the sequence thus far, which are (2, 3, 1, 1, 1, 2). 4 is the smallest missing number, so a(13)=4.
		

Crossrefs

Programs

  • Mathematica
    K = {1}; While[Length@K <= 85, A = {}; For[q = Last@K, q <= Length@K, q += Last@K, AppendTo[A, K[[q]]]]; k = 1; While[MemberQ[A, k], k++]; AppendTo[K, k]]; Print[K]  (* Samuel Harkness, Mar 06 2023 *)
  • PARI
    { p = 1; for (n = 1, #a = vector(86), x = 2^0; forstep (k = p, n-1, p, x = bitor(x, 2^a[k]);); print1 (p = a[n] = valuation(1+x,2)", ");); } \\ Rémy Sigrist, Mar 02 2023

A361929 a(1) = 2; for n > 1, a(n) is the smallest positive integer > 1 not to share a factor with terms a(n-c .. n-1) where c = gcd(n-1,a(n-1)).

Original entry on oeis.org

2, 3, 2, 3, 2, 3, 5, 2, 3, 7, 2, 3, 5, 2, 3, 7, 2, 3, 5, 2, 3, 7, 2, 3, 5, 11, 2, 3, 2, 3, 5, 2, 3, 7, 2, 3, 5, 2, 3, 7, 2, 3, 5, 2, 3, 7, 2, 3, 5, 2, 3, 7, 2, 3, 5, 11, 2, 3, 2, 3, 5, 2, 3, 7, 2, 3, 5, 2, 3, 7, 11, 2, 3, 2, 5, 7, 2, 3, 5, 2, 3, 7, 2, 3, 5, 11
Offset: 1

Views

Author

Samuel Harkness, Mar 30 2023

Keywords

Comments

Conjecture: All primes will occur. See A361931 for the first occurrences of primes.
a(p+1) = 2 or 3 when p is prime.

Examples

			For a(26), we see a(25) = 5. Then gcd(25,5) = 5, so a(26) must not share a factor with any of the previous 5 terms. The previous 5 terms {a(21), a(22), a(23), a(24), a(25)} = {3, 7, 2, 3, 5}, and the least positive number not to share a factor with {3, 7, 2, 3, 5} is 11, so a(26) = 11.
The first terms, alongside gcd(n,a(n)):
  n  a(n)  gcd(n,a(n))
  -  ----  ----
  1     2     1
  2     3     1
  3     2     1
  4     3     1
  5     2     1
  6     3     3
  7     5     1
  8     2     2
  9     3     3
  10    7     1
		

Crossrefs

Cf. A358921, A361931 (indices of first occurrences).

Programs

  • Mathematica
    K = {2}; While[Length@K < 86, p = 2; While[MemberQ[K[[Length@K - GCD[Length@K, Last@K] + 1 ;; Length@K]], p], p = NextPrime[p]]; AppendTo[K, p]]; Print[K]
  • PARI
    isok(w, k) = for (i=1, #w, if (gcd(k, w[i]) > 1 , return(0));); 1;
    lista(nn) = my(va = vector(nn)); va[1] = 2; for (n=2, nn, my(k=2, ok = 0, w = vector(gcd(n-1, va[n-1]), i, va[n-i])); while (!ok, ok = isok(w, k); if (!ok, k++);); va[n] = k;); va; \\ Michel Marcus, Mar 31 2023

A359728 a(1) = 1; a(n) is the smallest positive number not among the first k terms where k is the number of times a(n-1) has occurred.

Original entry on oeis.org

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

Views

Author

Neal Gersh Tolunsky, Jan 11 2023

Keywords

Comments

A new number is always followed by a 2.

Examples

			a(4) is 3 because the previous term (2) appears two times; we therefore look at the first 2 terms (1,2). 3 is the smallest number not among them, so a(4) is 3.
a(21) is 5: We see that a(20)=4 appears 9 times; the smallest number not among the first 9 terms (1,2,2,3,2,3,3,3,4) is 5.
		

Crossrefs

Cf. A358921.

Programs

  • Mathematica
    K = {1}; While[Length@K < 87, T = Take[K, Count[K, Last@K]]; i = 1; While[MemberQ[T, i], i++]; AppendTo[K, i]]; Print[K] (* Samuel Harkness, Mar 12 2023 *)
  • PARI
    lista(nn) = my(va=vector(nn)); va[1] = 1; for (n=2, nn, my(k=#select(x->(x==va[n-1]), va)); my(vb=Vec(va, k), m); for(j=1, vecmax(vb)+1, if (! #select(x->(x==j), vb), m=j; break)); va[n] = m;); va; \\ Michel Marcus, Jan 13 2023

A361429 a(n) is the smallest positive number not among the terms between a(n-1) and the most recent previous term whose value appears with the same frequency (inclusive); if no such term exists, set a(n)=1; a(1)=1.

Original entry on oeis.org

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

Views

Author

Neal Gersh Tolunsky, Mar 11 2023

Keywords

Comments

From Samuel Harkness, Mar 11 2023: (Start)
Observations:
Record values k > 2 seem to occur at the following places:
First k for k == 0 (mod 3) occurs at n = 2^(k/3+2) + k/3 - 4;
First k for k == 1 (mod 3) occurs at n = 2^((k-1)/3+2) + (k-1)/3 - 3;
First k for k == 2 (mod 3) occurs at n = 3*(2^((k+1)/3)) + (k-14)/3.
For any value k, frequency(k) ~= 2*frequency(3+k). For any value j >= 0, frequency(2+j) ~= frequency(3+j) ~= frequency(4+j).
This sequence contains many recurring strings. For example, {1, 3, 4, 1, 2} occurs 12499 times in the first 100000 terms. From its 5th occurrence at a(40) through its 64th occurrence at a(517), the number of terms between each {1, 3, 4, 1, 2} minus one gives
{1 3 1 4 ...}
First 1 term of A001511, 3, first 1 term of A001511, 4.
{... 1 2 1 4 1 2 1 5 ...}
First 3 terms of A001511, 4, first 3 terms of A001511, 5.
{... 1 2 1 3 1 2 1 5 1 2 1 3 1 2 1 6 ...}
First 7 terms of A001511, 5, first 7 terms of A001511, 6.
{... 1 2 1 3 1 2 1 4 1 2 1 3 1 2 1 6 1 2 1 3 1 2 1 4 1 2 1 3 1 2 1 7 ...}
First 15 terms of A001511, 6, first 15 terms of A001511, 7.
(End)

Examples

			a(6)=4 because in the sequence so far (1, 1, 2, 1, 3), the most recent term with the same number of occurrences as a(5)=3 is a(3)=2. Between a(3) and a(5), (2, 1, 3), the smallest missing number is 4, so a(6)=4.
a(8)=2 because between a(7)=1 and the previous value with the same frequency count a(4)=1 (1, 3, 4, 1), the smallest missing number is 2, so a(8)=2.
		

Crossrefs

Programs

  • MATLAB
    See Links section.

A379692 a(1) = 1; a(n) is the most recently occurring value not among the last k terms where k is the number of times a(n-1) has occurred; if no such value exists, a(n) is the smallest unused positive integer.

Original entry on oeis.org

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

Views

Author

Neal Gersh Tolunsky, Dec 29 2024

Keywords

Comments

The number preceding and following each first occurrence is the same (with the exception of a(1)=1 which has no predecessor).

Examples

			To find a(14)=4, we see that a(13) = 2 has occurred 3 times in the sequence, so the most recently occurring value before (5, 1, 2) which is not equal to 5,1,2 is a(9) = 4, so a(14) = 4.
		

Crossrefs

Cf. A358921.
Showing 1-6 of 6 results.