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.

Previous Showing 21-30 of 35 results. Next

A358479 Number of 6's that appeared in the n-th step when constructing A030717.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 2, 2, 2, 1, 1, 0, 1, 1, 1, 1, 1, 2, 3, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3
Offset: 1

Views

Author

Seiichi Manyama, Nov 18 2022

Keywords

Comments

Also first differences of A358474.

Crossrefs

A358480 Number of 7's that appeared in the n-th step when constructing A030717.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 2, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2
Offset: 1

Views

Author

Seiichi Manyama, Nov 18 2022

Keywords

Comments

Also first differences of A358475.

Crossrefs

A030721 Record values in A030717.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 15, 18, 20, 23, 25, 30, 38, 49, 62, 77, 94, 110, 129, 149, 172, 195, 218, 241, 266, 293, 323, 356, 389, 424, 461, 500, 545, 593, 641, 688, 737, 787, 839, 896, 957, 1021, 1085, 1152, 1219, 1291, 1368, 1447, 1527, 1611, 1697, 1788
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

Extensions

More terms and simpler title from Sean A. Irvine, Apr 08 2020

A030722 Positions of records in A030717.

Original entry on oeis.org

1, 3, 6, 11, 16, 20, 25, 36, 44, 45, 53, 63, 75, 88, 104, 120, 140, 163, 188, 216, 247, 280, 316, 354, 395, 438, 483, 530, 580, 633, 689, 749, 811, 876, 945, 1017, 1095, 1178, 1264, 1352, 1444, 1539, 1638, 1743, 1853, 1967, 2084, 2206, 2331, 2461, 2597, 2737
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

Extensions

More terms and simpler title from Sean A. Irvine, Apr 08 2020

A030720 a(n)=least k such that s(k)=n, where s=A030717.

Original entry on oeis.org

1, 3, 6, 11, 16, 20, 25, 36, 44, 52, 45, 74, 192, 73, 53, 103, 86, 63, 121, 75, 636, 951, 88, 1023, 104, 164, 122, 815, 142, 120, 165, 248, 949, 950, 190, 1021, 1022, 140, 218, 948
Offset: 1

Views

Author

Keywords

Extensions

a(22)-a(40) from Sean A. Irvine, Apr 08 2020

A358386 Distinct values of A030717 in order of appearance.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 10, 15, 18, 14, 12, 20, 17, 23, 16, 25, 30, 19, 27, 38, 29, 49, 26, 31, 62, 35, 13, 77, 39, 94, 32, 42, 110, 45, 129, 43, 48, 149, 51, 172, 56, 195, 61, 218, 63, 64, 241, 71, 67, 266, 79, 70, 293, 87, 73, 21, 323, 75, 356, 101, 78, 389, 109, 82, 28, 424, 116, 88, 461, 125, 40, 33, 34, 22, 500
Offset: 1

Views

Author

Seiichi Manyama, Nov 13 2022

Keywords

Comments

Conjecture: 41 is not a term. This conjecture is related to A030720. Nowhere among the first 3*10^5 terms in A030717 does 41 appear.

Crossrefs

Programs

  • Ruby
    def A030717(n)
      ary = [1]
      (n - 1).times{
        ary += ary.uniq.sort.map{|i| ary.count(i)}
      }
      ary
    end
    p A030717(50).uniq

A342585 Inventory sequence: record the number of zeros thus far in the sequence, then the number of ones thus far, then the number of twos thus far and so on, until a zero is recorded; the inventory then starts again, recording the number of zeros.

Original entry on oeis.org

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

Views

Author

Joseph Rozhenko, Mar 16 2021

Keywords

Comments

To get started we ask: how many zero terms are there? Since there are no terms in the sequence yet, we record a '0', and having recorded a '0', we begin again: How many zero terms are there? There is now one 0, so we record a '1' and continue. How many 1's are there? There's currently one '1' in the sequence, so we record a '1' and continue. How many 2's are there? There are no 2's yet, so we record a '0', and having recorded a 0, we begin again with the question "how many zero terms are there?" And so on.
a(46) = 0 because no 8's appear before it; but note a higher number, namely 9, has appeared. - Michael S. Branicky, Mar 16 2021
A similar situation occurs at n=124, where 14 has not yet appeared in the sequence, although 15 has appeared.
Reminiscent of Van Eck's sequence A181391. - N. J. A. Sloane, May 02 2021
From Jan Ritsema van Eck, May 02 2021: (Start)
The first 1000 terms seem to grow more or less in saw-tooth fashion with the largest terms (= the number of 0's), as well as the distance between the 0's, both approximately equal to the inverse triangular numbers A003056 (see attached graph #1).
But the picture changes when we go out to 10000 terms. Around the 1700th term, the 1's become more frequent than the 0's and the largest values are consistently somewhat larger than the inverse triangular numbers. Around the 2500th term the 2's become the most frequent number. Also after some 4000 terms, the largest values become much larger than the inverse triangular numbers. See graph #2. (End)
Comment on the colored plot of the first 1000467 terms, from Hans Havermann, May 02 2021: (Start)
If one is drawing a points-joined graph, it will obscure some of the inherent large-number dynamics. To get around that, this plot joins the points with a green line, superimposing the actual points in blue. This plot was created by Mathematica.
Your browser will likely compress the very large image to window size, so click on it to expand.
The points fall into linear features of the various counts of the various integers. The count for each integer changes as we move towards infinity and hence crosses over (changes place with) other counts unpredictably.
I decided to chart (see the blue text) the twenty largest counts at the rightmost spike which runs from the zero at 997010 to the zero at 1000467. These largest values are for the counts of integers 2 to 21 and appear at a(997013) for the 2-count; a(997014) for the 3-count, ..., and a(997032) for the 21-count.
The counts are 15275, 26832, 40162, 48539, 56364, 54372, 53393, 43588, 37288, 27396, 22425, 16735, 13099, 11460, 9466, 8386, 7191, 6478, 5777, and 5208, respectively. In my text they are sorted largest-to-smallest and written "count @ integer-being-counted": 56364 @ 6, 54372 @ 7, 53393 @ 8, 48539 @ 5, ... 5208 @ 21. (End)
A useful view may be gained by plotting the sequence against itself with an offset. Using the "Plot 2" link in the web page footer, enter "A342585" as sequences 1 and 2. Select "Plot Seq2(n+shift) vs Seq1(n)" and "Draw line segments". Start with "1" as the shift. The sequence appears somewhat like a fan, the first 4 or 5 sectors showing clearly, later sectors overlying each other. Larger shift values effectively compress early sectors into the vertical axis, making later sectors more visible. - Peter Munn, May 08 2021
For a version where a row ends not at the first zero, but rather at the last zero, see A347317. - N. J. A. Sloane, Sep 10 2021
For n around 2.5*10^9, the upper envelope of the sequence seems to be growing roughly like n/50, or maybe like O(n/log(n)). - N. J. A. Sloane, Feb 10 2023

Examples

			As an irregular triangle this begins:
   0;
   1,  1,  0;
   2,  2,  2,  0;
   3,  2,  4,  1,  1,  0;
   4,  4,  4,  1,  4,  0;
   5,  5,  4,  1,  6,  2,  1,  0;
   6,  7,  5,  1,  6,  3,  3,  1,  0;
   7,  9,  5,  3,  6,  4,  4,  2,  0;
   8,  9,  6,  4,  9,  4,  5,  2,  1,  3,  0;
   9, 10,  7,  5, 10,  6,  6,  3,  1,  4,  2,  0;
  10, 11,  8,  6, 11,  6,  9,  3,  2,  5,  3,  2,  0;
  ...
For row lengths see A347299. - _N. J. A. Sloane_, Aug 27 2021
From _David James Sycamore_, Oct 18 2021: (Start)
a(1) is 0 because the count is reset, and as yet there is no zero term immediately following another term. a(2) = 1 since the count is reset, a(1) = 0 and a(0) precedes it. The count now increments to terms equal to 1.
a(3) = 1 since a(2) = 1 and a(1) precedes it. a(4) = 0 because there is no term equal to 2 which is immediately preceded by another term.
a(5) = 2 since the count is reset, a(1) = a(4) = 0 and a(0), a(3) respectively, precede them. (End)
		

Crossrefs

Records: A347305 and A348782.
Other inventory-type sequences: A030717, A174382, A333867, A358066, A357443, A356784.
A012257 (cf. also A011784) reverses the inventory process.
See A347062, A347738, A355916, A355917, A355918, A357317 for variants.

Programs

  • AWK
    # See Links section. - Luc Rousseau, May 02 2021
    
  • MATLAB
    function [val,arr]=invSeq(N) % val = Nth term, arr = whole array up to N
    k=0;
    arr=zeros(1,N); % pre-allocate array
    for i=1:N
        an=sum((k==arr(2:i)));
        arr(i)=an;
        if an == 0
            k = 0;
        else
            k=k+1;
        end
    end
    val=arr(end);
    end % Ben Cha, Nov 11 2022
    
  • Maple
    a:= proc(n) option remember; local t;
          t:= `if`(a(n-1)=0, 0, b(n-1)+1);
          b(n):=t; add(`if`(a(j)=t, 1, 0), j=1..n-1)
        end: b(1), a(1):= 0$2:
    seq(a(n), n=1..120);  # Alois P. Heinz, Mar 16 2021
  • Mathematica
    a[n_] := a[n] = Module[{t}, t = If[a[n-1] == 0, 0, b[n-1]+1];
         b[n] = t; Sum[If[a[j] == t, 1, 0], {j, 1, n-1}]];
    b[1] = 0; a[1] = 0;
    Array[a, 120] (* Jean-François Alcover, May 03 2021, after Alois P. Heinz *)
  • PARI
    A342585_vec(N,c=[],i)=vector(N,j, while(#c<=i||#c<=c[i+1], c=concat(c,0)); c[i+=1]+if(c[1+c[i]]++&&!c[i]||j==1,i=0)) \\ M. F. Hasler, Nov 13 2021
    
  • PARI
    \\ See Links section.
    
  • Python
    def calc(required_value_number):
        values_lst = []
        current_count = 0
        new_value = 0
        for i in range(required_value_number):
            new_value = values_lst.count(current_count)
            values_lst.append(new_value)
            if new_value == 0:
                current_count = 0
            else:
                current_count += 1
        return new_value # Written by Gilad Moyal
    
  • Python
    from collections import Counter
    def aupton(terms):
      num, alst, inventory = 0, [0], Counter([0])
      for n in range(2, terms+1):
        c = inventory[num]
        num = 0 if c == 0 else num + 1; alst.append(c); inventory.update([c])
      return alst
    print(aupton(84)) # Michael S. Branicky, Jun 12 2021
    
  • R
    # Prints the first 10,068 terms
    library("dplyr")
    options(max.print=11000)
    inventory <- data.frame(1, 0)
    colnames(inventory) <- c("n", "an")
    value_to_count = 0
    n = 1
    for(x in 1:128) # Increase the 128 for more terms. The number of terms
                    # given is on the order of x^1.9 in the region around 128.
      {
      status <- TRUE
      while(status)
        {
        count <- length(which(inventory$an == value_to_count))
        n = n + 1
        inventory <- rbind(inventory, c(n, count))
        status <- isTRUE(count != 0)
        value_to_count = value_to_count + 1
        }
      value_to_count = 0
      }
    inventory # Damon Lay, Nov 10 2023

A030777 The first list after the following procedure: starting with a list [3] and an empty list, repeatedly add the distinct values in both lists in descending order to the second list and add the corresponding frequencies of those values to the first list.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

The length of the first row after stage k is 1, 2, 4, 7, 10, 15, 22, 31, 42, 55, 70, 87, 106, ... - Peter Kagey, Apr 09 2020

Examples

			Stage 1: [
  [3],
  []
]
Stage 2: [
  [3, 1],
     [3]
]
Stage 3: [
  [3, 1, 2, 1],
     [3, 3, 1]
]
Stage 4: [
  [3, 1, 2, 1, 3, 1, 3],
     [3, 3, 1, 3, 2, 1]
]
Stage 5: [
  [3, 1, 2, 1, 3, 1, 3, 6, 2, 5],
     [3, 3, 1, 3, 2, 1, 3, 2, 1]
]
Stage 6: [
  [3, 1, 2, 1, 3, 1, 3, 6, 2, 5, 1, 1, 7, 4, 6],
     [3, 3, 1, 3, 2, 1, 3, 2, 1, 6, 5, 3, 2, 1]
]
		

Crossrefs

The second row is A030778.
Cf. A030717.

Programs

  • Ruby
    def a030777_list(generations)
        rows = [[3], []]
        (2..generations).each do
            new_additions = rows.flatten.uniq.sort.reverse.map do |j|
                [rows.flatten.count(j), j]
            end
            rows = rows.zip(new_additions.transpose).map { |r, n| r + n }
        end
        rows[0]
    end # Peter Kagey, Apr 09 2020

A030778 The second list after the following procedure: starting with a list [3] and an empty list, repeatedly add the distinct values in both lists in descending order to the second list and add the corresponding frequencies of those values to the first list.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

The length of the second row after stage k is 0, 1, 3, 6, 9, 14, 21, 30, 41, 54, 69, 86, 105, ... - Peter Kagey, Apr 09 2020

Examples

			Stage 1: [
  [3],
  []
]
Stage 2: [
  [3, 1],
     [3]
]
Stage 3: [
  [3, 1, 2, 1],
     [3, 3, 1]
]
Stage 4: [
  [3, 1, 2, 1, 3, 1, 3],
     [3, 3, 1, 3, 2, 1]
]
Stage 5: [
  [3, 1, 2, 1, 3, 1, 3, 6, 2, 5],
     [3, 3, 1, 3, 2, 1, 3, 2, 1]
]
Stage 6: [
  [3, 1, 2, 1, 3, 1, 3, 6, 2, 5, 1, 1, 7, 4, 6],
     [3, 3, 1, 3, 2, 1, 3, 2, 1, 6, 5, 3, 2, 1]
]
		

Crossrefs

The first row is A030777.
Cf. A030717.

Programs

  • Ruby
    def a030777_list(generations)
        rows = [[3], []]
        (2..generations).each do
            new_additions = rows.flatten.uniq.sort.reverse.map do |j|
                [rows.flatten.count(j), j]
            end
            rows = rows.zip(new_additions.transpose).map { |r, n| r + n }
        end
        rows[1]
    end # Peter Kagey, Apr 09 2020

A333867 Table with T(1,1) = 1; for n>1, T(n,k) is the number of k's in rows 1 through n-1.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

Equivalently, list 1, where, at stage k>1, write i in list 1 and j in list 2, where i is the number of j's in list 1, for j=1,2,...,m, where m=max number in list 1 from stages 1 to k-1; stage 1 is 1 in list 1.
Differs from A030717 in that this sequence includes 0's. - Sean A. Irvine, Apr 08 2020
Nevertheless, this sequence starts each row with the count of 1's, not 0's, whose counts are not recorded in the sequence (cf. A174382, which is also initialized with a 0). - Peter Munn, Oct 11 2022

Examples

			1;
1;
2;
2, 1;
3, 2;
3, 3, 1;
4, 3, 3;
		

Crossrefs

Cf. A126027 (row lengths), A006920, A030717 (zeros suppressed).
Cf. A174382.
Cf. A253170 (row sums).

Programs

  • Haskell
    import Data.List (sort, group)
    a030717 n k = a030717_tabf !! (n-1) !! (k-1)
    a030717_row n = a030717_tabf !! (n-1)
    a030717_tabf = [1] : f [1] where
       f xs = ys : f ((filter (> 0) ys) ++ xs) where
              ys = h (group $ sort xs) [1..] where
                   h [] _ = []
                   h vss'@(vs:vss) (w:ws)
                     | head vs == w = (length vs) : h vss ws
                     | otherwise    = 0 : h vss' ws
    -- Reinhard Zumkeller, Dec 28 2014
  • Mathematica
    t = {{1}}; Do[AppendTo[t, BinCounts[#, {1, Max[#] + 1}] &[Flatten[t]]], {30}];
    Map[Length, t] (* A126027*)
    Map[Total, t]  (* A253170*)
    Flatten[t]     (* A333867 *)  (* Peter J. C. Moses, Apr 09 2020 *)

Extensions

More terms from Franklin T. Adams-Watters, Dec 14 2006
Previous Showing 21-30 of 35 results. Next