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.

User: Leo Crabbe

Leo Crabbe's wiki page.

Leo Crabbe has authored 3 sequences.

A381135 Numbers of the form d_1 d_2 d_3 ... where the sum of their digits multiplied by their digit positions is equal to their number of digits.

Original entry on oeis.org

1, 20, 110, 300, 1010, 2100, 4000, 10010, 12000, 20100, 31000, 50000, 100010, 111000, 200100, 220000, 301000, 410000, 600000, 1000010, 1020000, 1101000, 1300000, 2000100, 2110000, 3001000, 3200000, 4010000, 5100000, 7000000, 10000010, 10110000, 11001000, 12100000
Offset: 1

Author

Leo Crabbe, Feb 14 2025

Keywords

Comments

The digits for these numbers are 1-indexed.
Numbers k such that A156207(k) = A055642(k).

Examples

			301000 is a member of this sequence because it has 3*1 + 1*3 = 6 digits.
		

Crossrefs

Programs

  • PARI
    isok(k) = my(d=digits(k)); sum(i=1, #d, i*d[i]) == #d; \\ Michel Marcus, Feb 17 2025
  • Python
    def ok(n): return sum(int(d)*(i+1) for i, d in enumerate(str(n))) == len(str(n))
    
  • Python
    # see linked program for a different algorithm
    from itertools import count, islice
    from sympy.utilities.iterables import partitions
    def agen(): # generator of terms
        for d in count(1): yield from sorted(int("".join(str(p[k]) if k in p else "0" for k in range(1, d+1))) for p in partitions(d, m=d, k=d) if max(p.values()) < 10 if 1 in p and p[1] != 0)
    print(list(islice(agen(), 34))) # Michael S. Branicky, Feb 19 2025
    

Extensions

More terms from Michel Marcus, Feb 17 2025

A380985 Numbers whose k-th digit indicates the number of digits which occur k times.

Original entry on oeis.org

1, 20, 110, 2100, 20100, 200100, 2000100, 20000100, 200000100, 2000000100, 20000000100, 200000000100, 2000000000100, 20000000000100, 200000000000100, 2000000000000100, 20000000000000100, 200000000000000100, 2000000000000000100, 20000000000000000100
Offset: 1

Author

Leo Crabbe, Feb 11 2025

Keywords

Comments

The most significant digit is digit position k=1, meaning that it counts how many numbers appear 1 time.

Examples

			110 is a term because 1 number appears once (0), 1 number appears twice (1) and 0 numbers appear 3 times.
		

Crossrefs

Cf. A046043.

Programs

  • Python
    from collections import Counter
    def ok(n):
        d = list(map(int, str(n)))
        c = Counter(Counter(d).values())
        return all(dk == c[k] for k, dk in enumerate(d, 1)) # Michael S. Branicky, Feb 18 2025

Formula

a(n) = 2*10^(n-1) + 100 for n >= 4. - Andrew Howroyd, Feb 22 2025

A349595 Number of self-counting sequences of length n (sequences indexed from 0 to (n-1) where a(i) is the number of times i appears in the sequence).

Original entry on oeis.org

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

Author

Leo Crabbe, Nov 22 2021

Keywords

Comments

There is exactly one self-counting sequence for any n > 6 and it will always be of the form [n-4, 2, 1, ..., 1, ...], where the second "1" is at the (n-4)th index, and the "..."s are filled with the appropriate number of zeros. For example, the only self-counting sequence of length 7 is [3, 2, 1, 1, 0, 0, 0], and the only self-counting sequence of length 15 is [11, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0].
Proof:
Let a be a self-counting sequence of finite length. Firstly, observe that for all such sequences, the sum of a(i) - 1 over all i must equal 0. The contributions to this sum from those i for which a(i) = 0 will be some number of -1s. How many such -1s? a(0). The contribution from the i=0 case will be a(0)-1 (note that a(0) cannot be equal to 0, so these two contribution cases are disjoint). Thus, if we sum a(i) - 1 over just those nonzero i for which a(i) is nonzero, we will get a(0) - (a(0) - 1) = 1. These a(i) - 1 values are all whole numbers >= 0, so for them to sum to 1 is precisely for one of them to be 1 and the rest to be 0. And thus, we have precisely one nonzero i at which a(i) is 2, and at the other nonzero i, we have a(i) is either 1 or 0, and the only configuration of these ones and zeros that works is to have a(1) = 2, a(2) = 1, a(a(0)) = 1 and a(i) = 0 for all other nonzero i.

Examples

			n = 4 is the smallest length that a self-counting sequence can have (without considering the empty sequence of length 0, which could be self-counting or not, depending on the definition). There are two self-counting sequences of length 4, namely [1, 2, 1, 0] and [2, 0, 2, 0]. We can verify the first one by counting the times each number appears: 0 appears once, 1 appears twice, 2 appears once and 3 appears zero times.
		

Formula

G.f.: x^4*(2 - x - x^2 + x^3)/(1 - x). - Stefano Spezia, Dec 08 2021