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.

A178341 Smallest multiple of 3 such that decimals digits 1, ..., k (k = 1, ..., 9) and 0 appear in any order.

Original entry on oeis.org

12, 12, 123, 12234, 12345, 123456, 12234567, 12345678, 123456789, 1023456789
Offset: 1

Views

Author

Eva-Maria Zschorn (e-m.zschorn(AT)zaschendorf.km3.de), May 25 2010

Keywords

Examples

			4 * 3 = 12
4 * 3 = 12
41 * 3 = 123
4078 * 3 = 12234
4115 * 3 = 12345
41152 * 3 = 123456
4078189 * 3 = 12234567
4115226 * 3 = 12345678
41152263 * 3 = 123456789
341152263 * 3 = 1023456789
		

Crossrefs

Cf. A178303.

Programs

  • Python
    def a(n):
        digset = "".join(str(d) for d in range(1, min(n+1, 11)))
        target, lb = set(digset), int(digset) if n < 10 else 1023456789
        m = lb if lb%3 == 0 else lb + 3 - lb%3
        while target - set(str(m)): m += 3
        return m
    print([a(n) for n in range(1, 11)]) # Michael S. Branicky, Dec 12 2021