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

A363764 a(1)=1, and thereafter, a(n) is the number of terms in the sequence thus far that appear with a frequency not equal to that of a(n-1).

Original entry on oeis.org

1, 0, 0, 1, 0, 2, 5, 5, 4, 7, 7, 5, 6, 10, 10, 9, 12, 12, 10, 10, 16, 16, 14, 18, 18, 15, 20, 20, 16, 20, 18, 16, 24, 26, 26, 27, 28, 28, 28, 24, 30, 33, 33, 31, 35, 35, 32, 37, 37, 33, 32, 35, 31, 37, 30, 39, 48, 48, 40, 50, 50, 41, 52, 52, 42, 54, 54, 43, 56, 56, 44, 58, 58
Offset: 1

Views

Author

Neal Gersh Tolunsky, Jun 28 2023

Keywords

Comments

The first time a number appears for the 8th time is a(1491228545) = 953950324. - Pontus von Brömssen, Jul 06 2023

Examples

			a(8)=5 occurs two times, so a(9) is the number of terms which do not occur two times, which is 4 (there are three 0s and one 2).
		

Crossrefs

Programs

  • MATLAB
    function a = A363764( max_n )
        s = zeros(1,max_n); a = 1; s(2) = 1;
        for n = 2:max_n
            a(n) = length(find(s(a+1)~=s(a(n-1)+1)));
            s(a(n)+1) = s(a(n)+1)+1;
        end
    end % Thomas Scheuerle, Jun 30 2023
  • Mathematica
    a[1] = 1; a[n_] := a[n] = Total[Select[Tally[v = Array[a, n - 1]][[;; , 2]], # != Count[v, a[n - 1]] &]]; Array[a, 100] (* Amiram Eldar, Jun 30 2023 *)
  • Python
    from itertools import count,islice
    from collections import defaultdict
    def A363764_gen():
        x = 1
        freq = defaultdict(int)
        freq[x] = f0 = 1
        freqfreq = defaultdict(int)
        freqfreq[1] = 1
        for n in count(1):
            yield x
            x = n-f0*freqfreq[f0]
            freq[x] = f0 = freq[x]+1
            if f0 != 1: freqfreq[f0-1] -= 1
            freqfreq[f0] += 1
    def A363764_list(nmax):
        return list(islice(A363764_gen(), nmax)) # Pontus von Brömssen, Jul 01 2023 (after an idea by Kevin Ryde)
    

A363301 a(1)=1, and thereafter, a(n) is the number of terms in the sequence thus far that appear with a frequency equal to or less than that of a(n-1).

Original entry on oeis.org

1, 1, 2, 1, 4, 2, 3, 2, 8, 3, 4, 5, 2, 13, 3, 11, 4, 13, 5, 6, 3, 21, 4, 23, 5, 13, 14, 6, 7, 6, 18, 7, 8, 9, 6, 35, 7, 21, 10, 7, 40, 8, 22, 9, 12, 9, 26, 10, 13, 49, 10, 27, 11, 14, 15, 10, 56, 11, 30, 12, 17, 12, 34, 13, 64, 14, 37, 15, 18, 19, 14, 66, 15, 40, 20, 15, 71, 16, 17, 24, 17, 44, 18, 46, 19, 24
Offset: 1

Views

Author

Neal Gersh Tolunsky, May 26 2023

Keywords

Examples

			a(3)=2 because a(2)=1 occurs with a frequency of 2 and there are two terms in the sequence thus far that appear with a frequency of 2 or less (1, 1).
a(6)=3 because a(5)=2 occurs with a frequency of 2 and there are three terms that appear with a frequency of 2 or less (2, 2, and 4).
		

Crossrefs

Cf. A350768.

Programs

  • Python
    from itertools import islice
    from collections import Counter
    def agen(): # generator of terms
        an, c, freqs = 1, Counter(), Counter()
        while True:
            if an in c:
                freqs[c[an]] -= 1
            c[an] += 1
            freqs[c[an]] += 1
            yield an
            an = sum(v*freqs[v] for v in range(1, c[an]+1))
    print(list(islice(agen(), 86))) # Michael S. Branicky, May 26 2023

A372596 a(1)=-1; thereafter a(n) is (the number of terms that appear with a different frequency from that of a(n-1)) minus (the number of terms that appear with the same frequency).

Original entry on oeis.org

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

Views

Author

Neal Gersh Tolunsky, May 05 2024

Keywords

Examples

			Let t'(n) be the number of terms that appear with a different frequency from that of a(n-1) and t(n) be the number of remaining terms.
The resulting a(n) = t'(n) - t(n) are then:
   n  t'(n)  t(n) a(n)
  --  ----  ----  ----
   1     *     *    -1
   2     0     1    -1
   3     0     2    -2
   4     2     1     1
   5     2     2     0
   6     2     3    -1
   7     3     3     0
   8     5     2     3
   9     5     3     2
  10     5     4     1
		

Crossrefs

Programs

  • PARI
    \\ See Links section.

A372598 a(1)=-2; thereafter a(n) is (the number of terms thus far that appear with a different frequency from that of a(n-1)) minus (the number of terms that appear with the same frequency).

Original entry on oeis.org

-2, -1, -2, -1, -4, 3, 2, 1, 0, -1, 4, -1, 4, 5, 2, 3, 0, -3, 10, 9, 8, 7, 6, 5, 0, 19, 8, 3, 16, 11, 10, 7, 4, 15, 16, 7, 12, 19, 10, 9, 12, 9, 6, 11, 8, 3, 30, 37, 36, 35, 34, 33, 32, 31, 30, 19, 14, 33, 22, 35, 20, 37, 18, 39, 38, 37, 18, 23, 40, 39, 22, 19
Offset: 1

Views

Author

Neal Gersh Tolunsky, May 06 2024

Keywords

Examples

			Let t'(n) be the number of terms that appear with a different frequency from that of a(n-1) and t(n) be the number of remaining terms.
  The resulting a(n) = t'(n) - t(n) are then:
   n  t'(n)  t(n) a(n)
  --  ----  ----  ----
   1     *     *    -2
   2     0     1    -1
   3     0     2    -2
   4     1     2    -1
   5     0     4    -4
   6     4     1     3
   7     4     2     2
   8     4     3     1
   9     4     4     0
  10     4     5    -1
		

Crossrefs

Programs

  • PARI
    \\ See Links section.

A359010 Variant of the inventory sequence: Record the number of terms whose value occurs once thus far in the sequence, then the number of terms whose value occurs twice thus far, and so on; a row ends when a 0 that would repeat infinitely is reached.

Original entry on oeis.org

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

Views

Author

Neal Gersh Tolunsky, Dec 11 2022

Keywords

Comments

Note that we are counting terms with repetition. For example, to find a(5)=4, we are looking for the number of terms that appear twice. 0 and 1 each occur twice, which is 2+2=4 (not 1+1=2). This means that each column contains only multiples of the number of occurrences it is counting.
A row ends when a 0 is reached as the k-th term in a row and the only value left occurring greater than or equal to k times is 0. - Neal Gersh Tolunsky, Feb 08 2025

Examples

			First few rows of irregular triangle:
  0;
  1,  0;
  1,  4,  0;
  1,  0,  3,  4,  0;
  1,  2,  0,  4,  0;
  2,  2,  6,  4,  0;
  2,  0,  0, 12,  0;
  3,  2,  0,  8,  5,  0;
  4,  2,  0,  4,  0, 12,  0;
  3,  2,  3,  8,  0,  6,  7,  0;
  2,  6,  3,  4,  5,  0,  7,  8,  0;
		

Crossrefs

Programs

  • Python
    from collections import Counter
    from itertools import count, islice
    def end_cond(I, k): # the only value left occurring >= k times is 0
        return I[0] >= k and not any(I[i] >= k for i in I if i > 0)
    def agen(): # generator of terms
        I = Counter()
        while True:
            for i in count(1):
                c = sum(v for v in I.values() if v==i)
                yield c
                I[c] += 1
                if c == 0 and end_cond(I, i):
                    break
    print(list(islice(agen(), 86))) # Michael S. Branicky, Jan 28 2025
Showing 1-5 of 5 results.