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.

A329981 a(1) = 0, and for n > 0, a(n+1) = floor(k / 3) where k is the number of terms equal to a(n) among the first n terms.

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Nov 26 2019

Keywords

Comments

In other words, for n > 0, a(n+1) = floor(o(n) / 3) where o is the ordinal transform of the sequence.
Every nonnegative number appears infinitely many times in the sequence.
The second difference of the positions of the zeros in the sequence appears to be eventually 6-periodic.

Examples

			The first terms, alongside their ordinal transform, are:
  a   a(n)  o(n)
  --  ----  ----
   1     0     1
   2     0     2
   3     0     3
   4     1     1
   5     0     4
   6     1     2
   7     0     5
   8     1     3
   9     1     4
  10     1     5
  11     1     6
  12     2     1
		

Crossrefs

See A329982, A329984, A329985 and A330004 for similar sequences.

Programs

  • PARI
    o = vector(7); v=0; for (n=1, 87, print1 (v", "); v=o[1+v]++\3)

A364835 a(1) = 1; a(n+1) = (number of times a(n)+1 has appeared) - (number of times a(n) has appeared).

Original entry on oeis.org

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

Views

Author

Rok Cestnik, Aug 28 2023

Keywords

Comments

Irregular until n=149695 at which point it follows a simple pattern (see formula).

Examples

			a(5) = 2 - 1 = 1 because a(4) + 1 = -1 has appeared twice before and a(4) = -2 has appeared once.
a(7) = 2 - 2 = 0 because a(6) + 1 = -1 and a(6) = -2 have both appeared twice before.
		

Crossrefs

Programs

  • Mathematica
    nmax=78; a={1}; For[n=1, n<=nmax, n++, AppendTo[a,Count[a,Part[a,n]+1]-Count[a,Part[a,n]]]]; a (* Stefano Spezia, Aug 29 2023 *)
  • Python
    a=[1]
    for n in range(1000):
        a.append(a.count(a[n]+1)-a.count(a[n]))
    
  • Python
    from itertools import islice
    from collections import Counter
    def agen(): # generator of terms
        an = 1; c = Counter([1])
        while True: yield an; an = c[an+1] - c[an]; c[an] += 1
    print(list(islice(agen(),1001))) # Michael S. Branicky, Aug 29 2023

Formula

For n >= 149695: a(n) = 49456 - n/3 if (n mod 3) = 0, otherwise a(n) = (n mod 3) - 1.
Showing 1-2 of 2 results.