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

A276457 a(n) is the number of times that a(n-1) appears in the concatenation of all numbers from a(0) to a(n-2), with a(0) = 0.

Original entry on oeis.org

0, 0, 1, 0, 2, 0, 3, 0, 4, 0, 5, 0, 6, 0, 7, 0, 8, 0, 9, 0, 10, 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

Yuriy Sibirmovsky, Sep 03 2016

Keywords

Comments

138, 185 and 199 are three smallest numbers that do not appear among the first 5000 terms of the sequence. They first appear at n = 8776, 5117 and 10580 respectively.
1187 and 1190 are two smallest numbers that do not appear among the first 100000 terms.
Question: will every natural number eventually appear in the sequence?
The sequence can be started with any number a(0). The terms will be different, but for larger n behavior will be similar for all a(0).

Examples

			From a(0) to a(0), a(1) appears once, thus a(2) = 1.
From a(0) to a(1), a(2) appears 0 times, thus a(3) = 0.
...
From a(0) to a(19), a(20) = 10 appears once, in the form of '1,0'. Thus a(21) = 1.
		

Crossrefs

Similar in spirit to van Eck's A181391.

Programs

  • Mathematica
    Nm=100;
    A=Table[0,{j,1,Nm}];
    A[[3]]=1;
    Do[B=Table[IntegerDigits[A[[l]]],{l,1,j-1}];
    A[[j+1]]=SequenceCount[Flatten[B],IntegerDigits[A[[j]]]],{j,3,Nm-1}];
    A

Formula

a(n) = A142150(n) = A171181(n), if 0<=n<=20.
a(n) = A248034(n-19), if 21<=n<=120. - Omar E. Pol, Sep 03 2016

A249009 a(n+1) gives the number of occurrences of the first digit of a(n) so far, up to and including 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, 11, 13, 14, 15, 16, 17, 18, 19, 20, 2, 3, 3, 4, 3, 5, 3, 6, 3, 7, 3, 8, 3, 9, 3, 10, 21, 4, 4, 5, 4, 6, 4, 7, 4, 8, 4, 9, 4, 10, 23, 5, 5, 6, 5, 7, 5, 8, 5, 9, 5, 10, 24, 6, 6, 7, 6, 8, 6, 9, 6, 10
Offset: 0

Views

Author

Alois P. Heinz, Oct 18 2014

Keywords

Comments

Inspired by A248034.

Crossrefs

Cf. A249069 (analogous sequence in factorial base).

Programs

  • Maple
    a:= proc(n) option remember; `if`(n=0, 0,
          coeff(b(n-1), x, convert(a(n-1), base, 10)[-1] ))
        end:
    b:= proc(n) option remember; `if`(n=0, 1, b(n-1)+
          add(x^i, i=convert(a(n), base, 10)))
        end:
    seq(a(n), n=0..120);
  • Python
    from itertools import islice
    def A249009_gen(): # generator of terms
        c, clist = 0, [1]+[0]*9
        while True:
            yield c
            c = clist[int(str(c)[0])]
            for d in str(c):
                clist[int(d)] += 1
    A249009_list = list(islice(A249009_gen(),100)) # Chai Wah Wu, Dec 13 2022

A249148 a(1) = 1, after which, if a(n-1) = 1, a(n) = 1 + the total number of 1's that have occurred in the sequence so far, otherwise a(n) = the total number of times the least prime dividing a(n-1) [i.e., A020639(a(n-1))] occurs as a divisor (counted with multiplicity for each term) in the previous terms from a(1) up to and including a(n-1).

Original entry on oeis.org

1, 2, 1, 3, 1, 4, 3, 2, 4, 6, 7, 1, 5, 1, 6, 8, 11, 1, 7, 2, 12, 14, 15, 6, 16, 20, 22, 23, 1, 8, 26, 27, 10, 28, 30, 31, 1, 9, 13, 2, 32, 37, 1, 10, 38, 39, 14, 40, 43, 1, 11, 3, 15, 16, 47, 1, 12, 49, 7, 8, 52, 54, 55, 9, 22, 56, 59, 1, 13, 5, 10, 60, 62, 63, 25, 14, 64, 70, 71, 1, 14, 72, 75, 28, 77, 15, 29, 1, 15, 30, 78, 79, 1, 16, 83
Offset: 1

Views

Author

Antti Karttunen, Oct 24 2014

Keywords

Comments

Inspired by A248034.
After a(1), it is very likely that 1's occur only just after primes, although they do not necessarily occur after every prime. For example, 13 is the first prime whose initial occurrence is not followed by 1.

Examples

			a(1) = 1 by definition.
For n = 2, we see that a(1) = 1, which is the only 1 that has occurred in the sequence so far, and thus a(2) = 1+1 = 2.
For n = 3, we see that a(2) = 2, with the least prime dividing it being 2, which has occurred so far only once (namely in a(2)), thus a(3) = 1.
For n = 4, we see that a(3) = 1, and there has occurred two 1's so far (as a(1) and a(3)), thus a(4) = 2+1 = 3.
For n = 5, we see that a(4) = 3, with the least prime dividing it being 3, which has occurred now just once, thus a(5) = 1.
For n = 6, we see that a(5) = 1, and there has occurred three 1's so far (as a(1), a(3) and a(5)), thus a(6) = 3+1 = 4.
For n = 7, we see that a(6) = 4 = 2*2, with its least prime 2 dividing it two times, and also occurring once at a(2), thus a(7) = 3.
		

Crossrefs

Programs

  • PARI
    A049084(n) = if(isprime(n), primepi(n), 0); \\ This function from Charles R Greathouse IV
    A249148_write_bfile(up_to_n) = { my(pfcounts, n, a_n, f, k); pfcounts = vector(up_to_n); a_n = 1; for(n = 1, up_to_n, if((1 == a_n), pfcounts[1]++; a_n = pfcounts[1], f=factor(a_n); for(i=1,#f~,k = A049084(f[i,1])+1; pfcounts[k] += f[i,2]); a_n = pfcounts[A049084(f[1,1])+1]); write("b249148.txt", n, " ", a_n)); };
    A249148_write_bfile(10000);
    (MIT/GNU Scheme) ;; With memoizing definec-macro from Antti Karttunen's IntSeq-library and factor function from Aubrey Jaffer's SLIB-library.
    (definec (A249148 n) (if (= 1 n) 1 (vector-ref (A249148aux_primefactor_counts (- n 1)) (A055396 (A249148 (- n 1))))))
    (definec (A249148aux_primefactor_counts n) (cond ((= 1 n) (vector 2)) (else (let* ((a_n (A249148 n)) (copy-of-prevec (vector-copy (A249148aux_primefactor_counts (- n 1)))) (newsize (max (vector-length copy-of-prevec) (+ 1 (A061395 a_n)))) (pf_counts_vec (vector-grow copy-of-prevec newsize))) (let loop ((pf_indices (map A049084 (factor a_n)))) (cond ((null? pf_indices) pf_counts_vec) (else (vector-set! pf_counts_vec (car pf_indices) (+ 1 (or (vector-ref pf_counts_vec (car pf_indices)) 0))) (loop (cdr pf_indices)))))))))

A249144 a(0) = 0, after which a(n) gives the total number of runs of the same length as the rightmost run in the binary representation of a(n-1) [i.e., A136480(a(n-1))] among the binary expansions of all previous terms, including the runs in a(n-1) itself.

Original entry on oeis.org

0, 1, 2, 4, 1, 6, 7, 1, 8, 2, 11, 3, 4, 5, 17, 19, 7, 4, 8, 5, 25, 26, 29, 31, 1, 32, 2, 35, 12, 14, 37, 41, 45, 49, 50, 52, 22, 57, 58, 61, 63, 1, 64, 2, 67, 25, 69, 73, 76, 32, 3, 33, 80, 4, 34, 87, 14, 92, 35, 36, 38, 99, 42, 105, 108, 47, 5, 114, 116, 49, 119, 23, 24, 25, 123, 54, 126, 127, 1, 128, 2
Offset: 0

Views

Author

Antti Karttunen, Oct 22 2014

Keywords

Comments

Inspired by A248034.

Examples

			a(0) = 0 (by definition), and 0 is also '0' in binary.
For n = 1, we see that in a(0) there is one run of length 1, which is total number of runs of length 1 so far in terms a(0) .. a(n-1), thus a(1) = 1.
For n = 2, we see that the rightmost run of a(1) = 1 ('1' also in binary) has occurred two times in total (once in a(0) and a(1)), thus a(2) = 2.
For n = 3, we see that the rightmost run of a(2) = 2 ('10' in binary) is one bit long, and so far there has occurred four such runs in total (namely once in a(0) and a(1), twice in a(2)), thus a(3) = 4.
For n = 4, we see that the rightmost run of a(3) = 4 ('100' in binary) is two bits long, and it is so far the first and only two-bit run in the sequence, thus a(4) = 1.
For n = 5, we see that the rightmost run of a(4) = 1 ('1' in binary) is one bit long, and so far there has occurred 6 such one-bit runs in terms a(0) .. a(4), thus a(5) = 6.
For n = 6, we see that the rightmost run of a(5) = 6 ('110' in binary) is one bit long, and so far there has occurred 7 such one bit runs in terms a(0) .. a(5), thus a(6) = 7.
		

Crossrefs

A249146 a(0) = 0, after which a(n) gives the total number of runs of the same length as the maximal run in the binary representation of a(n-1) [i.e., A043276(a(n-1))] among the binary expansions of all previous terms, including the runs in a(n-1) itself.

Original entry on oeis.org

0, 1, 2, 4, 1, 6, 2, 9, 3, 4, 5, 15, 1, 16, 2, 19, 7, 1, 21, 26, 8, 2, 32, 1, 34, 3, 9, 10, 43, 11, 12, 14, 4, 15, 3, 16, 4, 17, 5, 58, 6, 18, 19, 21, 71, 8, 9, 22, 23, 10, 84, 24, 11, 26, 27, 29, 12, 31, 2, 99, 13, 34, 14, 15, 5, 108, 37, 38, 40, 16, 6, 41, 42, 130, 3, 43, 44, 46, 17, 18, 47, 7, 19, 49
Offset: 0

Views

Author

Antti Karttunen, Oct 22 2014

Keywords

Examples

			a(0) = 0 (by definition), and 0 is also '0' in binary we consider it to contain a single run of length one.
For n = 1, we see that in a(0) there is one run of length 1, which is total number of runs of length 1 so far in terms a(0) .. a(n-1), thus a(1) = 1.
For n = 2, we see that the only and thus also the longest run of a(1) = 1 ('1' also in binary) has occurred two times in total (once in a(0) and a(1)), thus a(2) = 2.
For n = 3, we see that there are two runs in a(2) = 2 ('10' in binary), both one bit long, and so far there has occurred four such runs in total (namely once in a(0) and a(1), twice in a(2)), thus a(3) = 4.
For n = 4, we see that the longest run of a(3) = 4 ('100' in binary) is two bits long, and it is so far the first and only two-bit run in the sequence, thus a(4) = 1.
For n = 5, we see that the longest run of a(4) = 1 ('1' in binary) is one bit long, and so far there has occurred 6 such one-bit runs in terms a(0) .. a(4), thus a(5) = 6.
For n = 6, we see that the longest run of a(5) = 6 ('110' in binary) is two bits long, and so far there has occurred 2 such two bit runs (once in terms a(3) and a(5)), thus a(6) = 2.
		

Crossrefs

A322182 a(1) = 1, and for any n > 0, a(n+1) is the number of occurrences of the n-th digit of the sequence among the first n digits of the sequence.

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

Views

Author

Rémy Sigrist, Nov 30 2018

Keywords

Comments

In other words, if we take the ordinal transform of the digits of the sequence and prepend the number 1, then we obtain the sequence again.
The number 1 appears 11 times.
Any number > 1 appears 10 times.
The sequence contains arbitrarily large runs of consecutive numbers.

Examples

			The first terms of the sequence, alongside the (n-1)-th digit of the sequence, are:
  n    a(n)  (n-1)-th digit
  ---  ----  --------------
    1     1             N/A
    2     1               1
    3     2               1
    4     1               2
    5     3               1
    6     1               3
    7     4               1
    8     1               4
    9     5               1
   10     1               5
   11     6               1
   12     1               6
   13     7               1
   14     1               7
   15     8               1
   16     1               8
   17     9               1
   18     1               9
   19    10               1
   20    11               1
   21     1               0
		

Crossrefs

Cf. A248034.

Programs

  • PARI
    a = [1]; ord = vector(base = 10); for (k=1, 59, a = concat(a, apply(d -> ord[1+d]++, digits(a[k], #ord)))); print (a)

A364788 a(0) = 0; thereafter a(n) is the number of times the last digit of a(n-1) has occurred as last digit in all terms prior to a(n-1).

Original entry on oeis.org

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

Views

Author

David James Sycamore, Aug 07 2023

Keywords

Comments

If d is the last digit of a(n-1), and d has occurred as last digit of a(j), 0 <= j < n-1, a total of k times, then a(n) = k (compare with A248034).

Examples

			a(1) = 0 because a(0) = 0 has been repeated 0 times. a(2) = 1 because a(1) = 0 has been repeated once.
a(22) = 11 has last digit 1, and there has been only one occurrence of a prior term having 1 as last digit (a(2) = 1), therefore a(23) = 1.
a(53) = 2 (last digit is 2) and there are 9 prior terms with last digit = 2 (8 terms = 2, and a(40) = 12). Therefore a(54) = 9.
		

Crossrefs

Cf. A248034.

Programs

Extensions

More terms from Michael De Vlieger, Aug 08 2023

A358851 a(n+1) is the number of occurrences of the largest digit 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, 11, 13, 2, 2, 3, 3, 4, 2, 4, 3, 5, 2, 5, 3, 6, 2, 6, 3, 7, 2, 7, 3, 8, 2, 8, 3, 9, 2, 9, 3, 10, 15, 4, 4, 5, 5, 6, 4, 6, 5, 7, 4, 7, 5, 8, 4, 8, 5, 9, 4, 9, 5, 10, 17, 6, 6, 7, 7, 8, 6
Offset: 0

Views

Author

Bence Bernáth, Dec 08 2022

Keywords

Comments

Up to a(19)=10, the terms are identical to A248034. The branches (distinct lines of terms indicating the largest digit of the preceding term) can be labeled by the counter digit (shown in the scatter plot). From 9 to 1 the branches gradually get fragmented. Below digit 5 it is harder to disentangle the branches in some places. A repeating pattern also appears (shown in the inset of the scatter plot).

Crossrefs

Programs

A249068 a(n+1) gives the number of occurrences of the last digit of a(n) in octal base so far, up to and including 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, 2, 2, 3, 2, 4, 2, 5, 2, 6, 2, 7, 2, 8, 3, 3, 4, 3, 5, 3, 6, 3, 7, 3, 8, 4, 4, 5, 4, 6, 4, 7, 4, 8, 5, 5, 6, 5, 7, 5, 8, 6, 6, 7, 6, 8, 7, 7, 8, 8, 9, 18, 10, 11, 9, 22, 9, 24, 10, 13, 9, 28, 9, 30, 10, 14, 11, 13, 10, 15, 9, 38, 12, 11, 14, 13, 11, 15
Offset: 0

Views

Author

Antti Karttunen, Oct 21 2014

Keywords

Comments

This is the octal version of Eric Angelini's A248034.

Examples

			For n=16, we see that a(15) = 8, '10' in octal, and '0' has occurred just twice in the octal representations of terms a(0) .. a(15), namely in a(0) = 0 (which is also zero when read in octal base) and a(15), thus a(16) = 2.
		

Crossrefs

Cf. A248034 (analogous sequence in base-10), A007094 (octal representation of n).

A358967 a(n+1) gives the number of occurrences of the smallest digit of a(n) so far, up to and including 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, 8, 8, 9, 8, 10, 9, 9, 10, 10, 11, 22, 12, 23, 14
Offset: 0

Views

Author

Bence Bernáth, Dec 08 2022

Keywords

Comments

Up to a(103)=12, the terms are identical to A248034.

Crossrefs

Programs

  • MATLAB
    length_seq=150;
    sequence(1)=0;
    seq_for_digits=(num2str(sequence(1))-'0');
    for i1=1:1:length_seq
         sequence(i1+1)=sum(seq_for_digits==min((num2str(sequence(i1))-'0'))');
         seq_for_digits=[seq_for_digits, num2str(sequence(i1+1))-'0'];
    end
    
  • Python
    sequence=[0]
    length=150
    seq_for_digits=list(map(int, list(str(sequence[0]))))
    for ii in range(length):
       sequence.append(seq_for_digits.count(min(list(map(int,list(str(sequence[-1])))))))
       seq_for_digits.extend(list(map(int, list(str(sequence[-1])))))
Showing 1-10 of 14 results. Next