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 11-14 of 14 results.

A278288 a(n) is the number of ways to represent a(n-1) as a sum of two distinct terms from a(0) to a(n-2). a(0) = 0. a(1) = a(2) = 1.

Original entry on oeis.org

0, 1, 1, 1, 2, 3, 3, 4, 6, 2, 4, 8, 3, 8, 4, 12, 6, 10, 10, 11, 12, 15, 9, 12, 19, 7, 15, 17, 10, 18, 22, 17, 12, 22, 21, 22, 25, 25, 26, 22, 26, 26, 27, 32, 25, 30, 27, 35, 21, 23, 31, 31, 32, 37, 37, 38, 37, 39, 37, 40, 40, 41, 45, 28, 37, 42, 38, 50, 33, 43, 58, 34
Offset: 0

Views

Author

Yuriy Sibirmovsky, Nov 16 2016

Keywords

Comments

a(n) is the number of pairs (j, k) such that a(j) + a(k) = a(n-1), with 0 <= j, k < n-1 and j != k.
For large n, a(n) on average follows linear law a(n) ~ 0.7 n with linear spread (see the plot).
Unlike sequences such as A248034 or A276457, this sequence is base-independent.

Examples

			a(2) = a(1) + a(0), so a(3) = 1.
a(3) = a(1) + a(0) = a(2) + a(0), so a(4) = 2.
a(4) = a(3) + a(2) = a(3) + a(1) = a(2) + a(1), so a(5) = 3.
		

Crossrefs

Programs

  • Mathematica
    Nm=100;
    A=Table[1,{n,1,Nm}];
    A[[1]]=0;
    Do[Nc=0;
    Do[If[A[[j]]+A[[k]]==A[[n]] && k!=j,Nc++],{j,1,n-1},{k,1,j}];
    A[[n+1]]=Nc,{n,3,Nm-1}];
    A

A309872 For each term, take the last digit of the previous term and count all the appearances of that digit up to and including the previous term; the first term is 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, 1, 12, 2, 3, 2, 4, 2, 5, 2, 6, 2, 7, 2, 8, 2, 9, 2, 10, 2, 11, 16, 3, 3, 4, 3, 5, 3, 6, 4, 4, 5, 4, 6, 5, 5, 6, 6, 7, 3, 7, 4, 7, 5, 7, 6, 8, 3, 8, 4, 8, 5, 8, 6, 9, 3, 9, 4, 9, 5, 9, 6, 10, 3, 10, 4, 10, 5, 10, 6, 11, 23, 11
Offset: 1

Views

Author

Maxim Skorohodov, Aug 21 2019

Keywords

Examples

			To get the eleventh term, you need to get the last digit of the tenth term, which is 1, and then count all the 1's already in the sequence: 1, 1, 2, 1, 3, 1, 4, 1, 5, 1; there are six 1's, so the eleventh term is 6.
		

Crossrefs

Cf. A248034 (first term is 0).

Programs

  • Maple
    Q:= Array(0..9):
    A:= Vector(100):
    Q[1]:= 1:
    A[1]:= 1:
    for n from 2 to 100 do
      d:= A[n-1] mod 10;
      A[n]:= Q[d];
      L:= convert(%,base,10);
      for i in L do Q[i]:= Q[i]+1 od
    od:
    convert(A,list); # Robert Israel, Feb 18 2020
  • PARI
    f = vector(base=10); for (n=1, 91, v = if (n==1, 1, f[1+(v%base)]); apply (d -> f[1+d]++, if (v, digits(v, base), [0])); print1 (v ", ")) \\ Rémy Sigrist, Aug 21 2019
    
  • Python
    s, a, n = "1", [1], 1
    while n < 100:
        n = n+1
        d = s[len(s)-1]
        i, aa = 0, 0
        while i < len(s):
            if s[i] == d:
                aa = aa+1
            i = i+1
        s, a = s+str(aa), a+[aa]
    for n in range(1, 92): print(a[n-1], end=', ') # A.H.M. Smeets, Aug 22 2019

A359031 a(n+1) gives the number of occurrences of the mode of the digits of a(n) among all the digits of [a(0), a(1), ..., a(n)], with a(0)=0.

Original entry on oeis.org

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

Views

Author

Bence Bernáth, Dec 12 2022

Keywords

Comments

The mode is the most frequently occurring value among the digits of a(n). When there are multiple values occurring equally frequently, the mode is the smallest of those values.
Up to a(464)=110, the terms are identical to A358967.

Crossrefs

Programs

  • MATLAB
    length_seq=470;
    sequence(1)=0;
    seq_for_digits=(num2str(sequence(1))-'0');
    for i1=1:1:length_seq
         sequence(i1+1)=sum(seq_for_digits==mode((num2str(sequence(i1))-'0'))');
         seq_for_digits=[seq_for_digits, num2str(sequence(i1+1))-'0'];
    end
    
  • Python
    import statistics as stat
    sequence=[0]
    length=470
    seq_for_digits=list(map(int, list(str(sequence[0]))))
    for ii in range(length):
        sequence.append(seq_for_digits.count(stat.mode(list(map(int, list(str(sequence[-1])))))))
        seq_for_digits.extend(list(map(int, list(str(sequence[-1])))))

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

Views

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
Previous Showing 11-14 of 14 results.