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

A248034 a(n+1) gives the number of occurrences of the last 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
Offset: 0

Views

Author

Eric Angelini and M. F. Hasler, Oct 11 2014

Keywords

Comments

In other words, the number to the right of a comma gives the number of occurrences of the digit immediately to the left of the comma, counting from the beginning up to that digit or comma.

Crossrefs

Cf. A249068 (analogous sequence in base 8).
Cf. A249009 (analogous sequence which uses the first, not the last digit).

Programs

  • Maple
    a:= proc(n) option remember; `if`(n=0, 0,
          coeff(b(n-1), x, irem(a(n-1), 10)))
        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);  # Alois P. Heinz, Oct 18 2014
  • Mathematica
    nn = 120; a[0] = j = 0; c[] := 0; Do[Map[c[#]++ &, IntegerDigits[j]]; a[n] = j = c[Mod[j, 10]], {n, nn}]; Array[a, nn, 0] (* _Michael De Vlieger, Aug 07 2023 *)
  • PARI
    c=vector(10);print1(a=0);for(n=1,99,apply(d->c[d+1]++,if(a,digits(a)));print1(","a=c[1+a%10]))
    (MIT/GNU Scheme)
    ;; An implementation of memoization-macro definec can be found for example from: http://oeis.org/wiki/Memoization
    (definec (A248034 n) (if (zero? n) n (vector-ref (A248034aux_digit_counts (- n 1)) (modulo (A248034 (- n 1)) 10))))
    (definec (A248034aux_digit_counts n) (cond ((zero? n) (vector 1 0 0 0 0 0 0 0 0 0)) (else (let loop ((digcounts-for-n (vector-copy (A248034aux_digit_counts (- n 1)))) (n (A248034 n))) (cond ((zero? n) digcounts-for-n) (else (vector-set! digcounts-for-n (modulo n 10) (+ 1 (vector-ref digcounts-for-n (modulo n 10)))) (loop digcounts-for-n (floor->exact (/ n 10)))))))))
    ;; Antti Karttunen, Oct 22 2014
    
  • Python
    from itertools import islice
    def A248034_gen(): # generator of terms
        c, clist = 0, [1]+[0]*9
        while True:
            yield c
            c = clist[c%10]
            for d in str(c):
                clist[int(d)] += 1
    A248034_list = list(islice(A248034_gen(),30)) # Chai Wah Wu, Dec 13 2022

A380690 a(0) = 0; a(n) = the number of times a(n-1) has all digits in common with a previous term.

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, 0, 11, 1, 2, 1, 3, 1, 4, 1, 5, 1, 6, 1, 7, 1, 8, 1, 9, 1, 10, 1, 11, 12, 0, 12, 1, 13, 0, 13, 1, 14, 0, 14, 1, 15, 0, 15, 1, 16, 0, 16, 1, 17, 0, 17, 1, 18, 0, 18, 1, 19, 0, 19, 1, 20, 0, 20, 1, 21
Offset: 0

Views

Author

Sergio Pimentel, Jan 30 2025

Keywords

Comments

Every number should appear a limited number of times in the sequence as opposed as in A326834.

Examples

			a(24) = 2 since a(23) = 1 and previously there are two numbers that only have the digit '1': a(22) = 11 and a(2) = 1.
a(4062) = 113 since a(4061) = 112 and previously there are 113 occurrences of numbers that only have the digits '1' and '2' such as 12,21,112,121,122.
		

Crossrefs

Programs

A380745 a(0) = 0; a(n) = the number of times a(n-1) has the same digits in common with a previous term, in any permutation.

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, 0, 11, 0, 12, 0, 13, 0, 14, 0, 15, 0, 16, 0, 17, 0, 18, 0, 19, 0, 20, 0, 21, 1, 1, 2, 1, 3, 1, 4, 1, 5, 1, 6, 1, 7, 1, 8, 1, 9, 1, 10, 1, 11, 1, 12, 2, 2, 3, 2, 4, 2, 5, 2, 6, 2, 7, 2, 8, 2, 9, 2
Offset: 0

Views

Author

Sergio Pimentel, Jan 31 2025

Keywords

Comments

To find a(n), let L be the multiset of the digits of a(n-1). Then a(n) is the number of terms a(i), 0 <= i <= n-2, which also have L as the multiset of its digits. - N. J. A. Sloane, Mar 27 2025

Examples

			a(43) = 1 since a(42) = 21 and previously there is only one number in the sequence that contains both a 1 and a 2.
a(104) = 3 since a(103) = 11 and previously there are 3 numbers in the sequence that contain two 1's.
a(9942) = 14 since a(9941) = 155 and previously there are 14 numbers in the sequence that contain one 1 and two 5's.
		

Crossrefs

Programs

Showing 1-3 of 3 results.