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.

User: David James Sycamore

David James Sycamore's wiki page.

David James Sycamore has authored 317 sequences. Here are the ten most recent ones:

A384773 a(1) = 1, a(2) = 1. For n > 2 if a(n-1) = k is a novel term, a(n) = a(n-1-k). Otherwise if a(n-1) is a repeat term a(n) = number of m; 1 <= m <= n-2 such that a(m) = a(n-1).

Original entry on oeis.org

1, 1, 1, 2, 1, 3, 1, 4, 2, 1, 5, 3, 1, 6, 4, 1, 7, 1, 8, 5, 1, 9, 1, 10, 6, 1, 11, 1, 12, 7, 1, 13, 8, 1, 14, 1, 15, 9, 1, 16, 10, 1, 17, 1, 18, 11, 1, 19, 12, 1, 20, 1, 21, 13, 1, 22, 1, 23, 14, 1, 24, 15, 1, 25, 1, 26, 16, 1, 27, 1, 28, 17, 1, 29, 18, 1, 30
Offset: 1

Author

David James Sycamore, Jun 09 2025

Keywords

Comments

a(n) <= n for all n, with equality for n = 1. Same as A364749 until a(12).
The sequence of indices of terms a(n-1-k) following novel terms k (starting: 2,3,4,6,8,10,11,13,...) appears to be A335999.
Records subsequence is A000027, with records occurring at indices 1, A026278.

Examples

			a(1) = a(2) = 1 implies a(3) = 1 since 1 has been repeated once. Then a(4) = 2 because now 1 has been repeated twice. Since 2 is a novel term a(5) = a(4-2) = a(2) = 1. Since 1 has been repeated three times a(6) = 3, another novel term so a(7) = a(6-3) = a(3) = 1.
		

Crossrefs

A383970 Inventory sequence: record the number of prior terms such that if 2 then 4, then 6,... are added the result is a prime. Reset the count at each term = 0.

Original entry on oeis.org

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

Author

David James Sycamore, May 16 2025

Keywords

Examples

			Initially there are no terms in the sequence which satisfy any condition so a(1) = 0, whereupon the count is reset. Now count the number of prior terms such that the addition of 2 gives a prime. Since 0 + 2 = 2 is prime, a(2) = 1, and we increment from 2 to 4 finding that 1+4 = 5 is prime thus a(3) = 1. Since adding 6 to all prior terms gives 6,7,7 two of which are prime, we have a(4) = 2. Adding 8 to all prior terms results in 8,9,10,8 which contains no primes, so a(5) = 0; and so on.
		

Crossrefs

Programs

A384533 Inventory sequence starting a(1) = 1 and thereafter recording the number of terms which are the product of 0,1,2,... primes (taken with multiplicity). The count resets following a term = 0.

Original entry on oeis.org

1, 1, 0, 2, 1, 0, 3, 2, 0, 3, 4, 1, 0, 4, 4, 3, 0, 4, 5, 4, 0, 4, 6, 7, 0, 4, 7, 8, 1, 0, 5, 9, 9, 1, 0, 6, 9, 12, 2, 0, 6, 10, 14, 2, 0, 6, 11, 16, 2, 1, 0, 7, 14, 17, 2, 1, 0, 8, 16, 17, 3, 2, 0, 8, 19, 17, 4, 2, 0, 8, 22, 19, 5, 2, 0, 8, 25, 20, 7, 2, 0, 8
Offset: 1

Author

David James Sycamore, Jun 01 2025

Keywords

Comments

When for some k, a(k) = 0, a(k+1) is the number 1's (empty products) in the sequence. The number of zero terms are never counted because there are no numbers whose product of prime factors = 0.

Examples

			a(1) = 1, so a(2) = 1 since there is one term which is the product of no primes.
a(3) = 0 since there are no terms which are the product of one prime.
Now the count resets and a(4) = 2 since there are two empty products (a(1) = a(2) = 1).
a(5) = 1 since a(4) = 2 is the product of one prime.
a(6) = 0 since there are no terms which are the product of two primes.
The count resets again and a(7) = 3, the number of empty products.
a(8) = 2 because there are now two terms (a(4) = 2 and a(7) = 3) which are the product of one prime.
Since there are still no terms which are the product of two primes, a(9) = 0.
a(10) = 3, still the number of empty products and a(11) = 4 since there are now four prime terms. This is the first term with two prime divisors (counted with multiplicity), implying that a(12), the next count of two prime divisors must be = 1. And so on.
		

Crossrefs

Cf. A342585.

A384660 a(1) = 1. Thereafter a(n) = a(a(n-1)) if a(n-1) is a novel term, or n - S(n) if a(n-1) is a repeat term. S(n) is the sum of distinct terms in multiset {a(1),a(2),..a(n-1)}.

Original entry on oeis.org

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

Author

David James Sycamore, Jun 06 2025

Keywords

Comments

Because of condition pertaining to novel terms the sequence contains a proper subsequence identical to itself, and consequently infinitely many such copies.

Examples

			a(1) = 1 is a novel term so a(2) = a(a(1)) = 1, which is a repeat term so a(3) = 3 - 1 = 2, another novel term so a(4) = a(a(2)) = a(1) = 1.
		

Crossrefs

Cf. A002260.

Extensions

More terms from Alois P. Heinz, Jun 06 2025

A383967 Inventory sequence recording number of terms with 1,2,3,... decimal digits. Count until occurrence of a term = 0, whereupon reset the count; continue.

Original entry on oeis.org

0, 1, 0, 3, 0, 5, 0, 7, 0, 9, 0, 11, 1, 0, 13, 2, 0, 15, 3, 0, 17, 4, 0, 19, 5, 0, 21, 6, 0, 23, 7, 0, 25, 8, 0, 27, 9, 0, 29, 10, 0, 30, 12, 0, 31, 14, 0, 32, 16, 0, 33, 18, 0, 34, 20, 0, 35, 22, 0, 36, 24, 0, 37, 26, 0, 38, 28, 0, 39, 30, 0, 40, 32, 0, 41, 34
Offset: 1

Author

David James Sycamore, May 16 2025

Keywords

Examples

			a(1) = 0 because at first there are no terms with just one decimal digit. Following a zero term the count is reset and now since there is one term (a(1) = 0) with just one digit, a(2) = 1. Since there are no terms with two digits a(3) = 0. The count resets again and a(4) = 3 because there are now three terms (0,1,0) which have only one digit. Since there are no terms with two digits a(5) = 0.
The sequence continues 0,1,0,3,0,5,0,7,0,9,0 and at this point we have 11 terms with one digit then one term (11) with two digits, so the next two terms are 11,1 followed by 0 since there is not yet a term with three digits; and so on.
		

Crossrefs

Programs

  • Mathematica
    nn = 120; q[] := 0; f[x] := If[x == 0, 1, IntegerLength[x]]; j = 0; c = 1; q[1]++; {j}~Join~Reap[Do[If[j == 0, c = 1]; j = Sow[q[c]]; c++; q[f[j]]++, nn - 1] ][[-1, 1]] (* Michael De Vlieger, Jun 01 2025 *)

A383969 a(n) is the smallest even number m such that the set {m+1, m+3, m+5, ..., m+(2*n-1)} contains no prime numbers.

Original entry on oeis.org

0, 24, 90, 114, 114, 114, 524, 524, 888, 1130, 1328, 1328, 1328, 1328, 1328, 1328, 9552, 15684, 15684, 15684, 15684, 19610, 19610, 19610, 19610, 31398, 31398, 31398, 31398, 31398, 31398, 31398, 31398, 31398, 31398, 155922, 155922, 155922, 155922, 155922, 155922, 155922
Offset: 1

Author

David James Sycamore, May 16 2025

Keywords

Comments

For a(2) onward, consists of terms of A008950(n), perhaps repeated, based on the increase in records. So, higher terms may be easily computed using the b-files at A008950 and A002386. - Michael S. Branicky, May 23 2025

Examples

			a(1) = 0 since 0 is the smallest even number such that 0 + 1 = 1 is not prime
a(2) = 24 since there are no primes in {24+1, 24+3} = {25, 27} and no smaller even number has this property.
a(3) = 90 since there are no primes in {91, 93, 95}, and no smaller even number has this property.
		

Crossrefs

Programs

  • Mathematica
    k = 0; Table[While[AnyTrue[k + Range[2*n - 1], PrimeQ], k += 2]; k, {n, 42}] (* Michael De Vlieger, Jun 01 2025 *)
  • Python
    from sympy import isprime
    from itertools import count
    def a(n): return next(m for m in count(0, 2) if all(not isprime(m+2*i+1) for i in range(n)))
    print([a(n) for n in range(1, 43)]) # Michael S. Branicky, May 23 2025

Extensions

a(4) and beyond from Michael S. Branicky, May 23 2025

A384503 Lexicographically earliest infinite sequence of distinct positive integers having the property that for any pair a(n-2) = i, a(n-1) = j of consecutive terms > 1, a(n) is the smallest novel k such that gcd(i,k) > 1 if gcd(i,j) = 1 or gcd(j,k) = 1 if gcd(i,j) > 1.

Original entry on oeis.org

1, 2, 3, 4, 6, 5, 8, 10, 7, 12, 14, 9, 16, 15, 18, 11, 20, 22, 13, 24, 26, 17, 28, 34, 19, 30, 38, 21, 32, 27, 36, 23, 33, 46, 39, 40, 42, 25, 35, 29, 45, 58, 48, 31, 44, 62, 37, 50, 74, 41, 52, 82, 43, 54, 86, 47, 56, 94, 49, 60, 63, 53, 51, 106, 57, 64, 66, 59
Offset: 1

Author

David James Sycamore, May 31 2025

Keywords

Comments

Three initial terms (1,2,3) are needed since starting 1,2 would require 1 to have a prime factor.
Similar to A280985 except that if for some m, a(m) = prime p, then a(m+2) = 2*p (whereas A280985(m+1) = 2*p).
Conjectured to be a permutation of the positive integers, with primes occurring in order.

Examples

			The lexicographically earliest condition requires that the sequence starts a(n) = n for n <= 3. Then with a(2) = 2 and a(3) = 3 a(4) must be 4, the smallest novel number sharing a prime divisor with 2 (since gcd(2,3) = 1). Since gcd(3,4) = 1, a(5) must be 6, the smallest novel number sharing a prime divisor with 3. Since gcd(4,6) > 1 a(6) = 5, the smallest novel number prime to a(4) = 4. a(8) = 8 because gcd(6,5) = 1 and then a(9) = 2*5 = 10 the smallest novel number sharing a factor with 5.
		

Crossrefs

Programs

  • Mathematica
    nn = 120; c[] := False; m[] := 1; c[1] = c[2] = c[3] = True; i = 2; j = 3; u = 4;
    Range[3]~Join~Reap[Do[
      If[CoprimeQ[i, j],
        If[PrimePowerQ[i],
          p = FactorInteger[i][[1, 1]]; While[c[p*m[p]], m[p]++]; k = p*m[p],
          k = u; While[Or[c[k], CoprimeQ[i, k]], k++] ],
        k = u; While[Or[c[k], ! CoprimeQ[j, k]], k++] ];
      Sow[k]; Set[{c[k], i, j}, {True, j, k}];
    If[k == u, While[c[u], u++]], {n, 3, nn}] ][[-1, 1]] (* Michael De Vlieger, May 31 2025 *)

Formula

For prime a(n) = p, a(n+2) = 2*p. - Michael De Vlieger, May 31 2025

A384309 a(1) = 1. Thereafter a(n) is the cardinality of the set of terms whose leading decimal digit is the same as that of a(n-1).

Original entry on oeis.org

1, 1, 2, 1, 3, 1, 4, 1, 5, 1, 6, 1, 7, 1, 8, 1, 9, 1, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 2, 3, 2, 4, 2, 5, 2, 6, 2, 7, 2, 8, 2, 9, 2, 10, 21, 11, 22, 12, 23, 13, 24, 14, 25, 15, 26, 16, 27, 17, 28, 18, 29, 19, 30, 3, 4, 3, 5, 3, 6, 3, 7, 3, 8, 3, 9, 3, 10, 31, 11
Offset: 1

Author

David James Sycamore, May 25 2025

Keywords

Comments

Conjecture: All positive integers appear precisely 9 times in this sequence, except for 1, which appears 10 times. For k >= 1, the last k digit term in the sequence is a(23[k-1]93) = [k]9 where "[m]9" means a run of m nines; see Example.

Examples

			a(1) = 1 is given so a(2) = 1, the number of terms having leading decimal digit = 1. Now there are two terms with leading digit = 1, so a(3) = 2. Since a(3) is the only term with leading digit = 2, a(4) = 1.
a(233) = 9 is the last one-digit term, a(2393) = 99 is the last two-digit term, a(23993) = 999 is the last three-digit term, etc.
		

Crossrefs

Programs

  • Mathematica
    nn = 120; c[] := 0; d[x] := First@ IntegerDigits[x]; j = 1; {j}~Join~Reap[Do[Sow[k = ++c[d[j]]]; j = k, {n, nn}] ][[-1, 1]] (* Michael De Vlieger, May 25 2025 *)
  • Python
    from itertools import islice
    from collections import Counter
    def agen(): # generator of terms
        an, c = 1, Counter()
        while True:
            yield an
            leading = str(an)[0]
            c[leading] += 1
            an = c[leading]
    print(list(islice(agen(), 80))) # Michael S. Branicky, May 25 2025

A384336 a(1) = 1, a(2) = 2. For n > 2, a(n) = number of a(k), k = 1..n-2 such that a(k) divides a(n-1).

Original entry on oeis.org

1, 2, 1, 1, 2, 4, 5, 3, 3, 4, 6, 7, 3, 5, 4, 7, 4, 8, 9, 6, 9, 7, 5, 5, 6, 10, 9, 8, 10, 10, 11, 3, 6, 12, 17, 3, 7, 6, 14, 9, 11, 4, 9, 12, 21, 12, 22, 7, 7, 8, 12, 23, 3, 8, 13, 3, 9, 15, 14, 12, 26, 6, 17, 4, 10, 12, 29, 3, 10, 13, 4, 11, 5, 7, 9, 17, 5, 8
Offset: 1

Author

David James Sycamore, May 28 2025

Keywords

Comments

1 appears 3 times and 2 appears 2 times, all other numbers are conjectured to appear infinitely many times. The first occurrence of an odd prime is followed by 3, see Example, and the order of first appearances of primes starts: 2,5,3,7,11,19,23,13.

Examples

			Since a(1) = 1, and a(2) = 2, a(3) must be 1 since there is only one term (a(1) = 1) which is a divisor of 2. Then a(4) = 1 because a(1) = 1 is the only prior divisor of a(3) = 1.
		

Crossrefs

Cf. A000005.

Programs

Extensions

More terms from Alois P. Heinz, Jun 01 2025

A383876 a(0) = 0, a(1) = 1. Let n be greatest index such that a(0),...a(n) are already known. If a(n) is not a record term, a(n+1) = number of k < n such that a(k) = a(n). If a(n) is a record term a(n+1) = a(r) where r is the greatest record < a(n).

Original entry on oeis.org

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

Author

David James Sycamore, May 13 2025

Keywords

Comments

After a(5) = 2 a record term produces a string of familiar terms leading to the next record, whereupon the process repeats (see Example). Since each record term increments its predecessor by +1, the records subsequence is A001477. If the first condition in Name is replaced by the "count back" function of A181391 the result is A025480 (n >= 1). The proper subsequence a(r), r a record = 0,1,2,3,..... is identical to the original, therefore the sequence contains infinitely many proper copies of itself. Every nonnegative integer appears infinitely many times.

Examples

			a(1) = 1 is a record term so a(2) = a(0) = 0 since 0 is the greatest record prior to 1. a(2) = 0, which has been seen once already so a(3) = 1, which has also been seen once already so a(4) = 1. Now there are two prior terms = 1, so a(5) = 2, and since this is a new record, a(6) = a(1) since 1 is the greatest record prior to 2. Therefore a(6) = 1. Now 1 has occurred 3 times prior to a(6) so a(7) = 3. The number of repeat terms between consecutive records varies, starting: 0,3,1,3,1,1..
		

Crossrefs

Programs

  • Mathematica
    nn = 10000; c[_] := 0; z = a[0] = 0; c[0]++; r = a[1] = 1; q = True;
    Do[If[q, k = a[z], k = c[a[n - 1]]];
      c[a[n - 1]]++; Set[{a[n], q}, {k, False}];
      If[k > r, Set[{z, r, q}, {r, k, True}] ], {n, 2, nn}];
    Array[a, nn + 1, 0] (* Michael De Vlieger, May 14 2025 *)