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.

A216479 a(n) is the least multiple of n which uses only the digit 1, or a(n) = -1 if no such multiple exists.

Original entry on oeis.org

1, -1, 111, -1, -1, -1, 111111, -1, 111111111, -1, 11, -1, 111111, -1, -1, -1, 1111111111111111, -1, 111111111111111111, -1, 111111, -1, 1111111111111111111111, -1, -1, -1, 111111111111111111111111111, -1, 1111111111111111111111111111, -1, 111111111111111, -1, 111111, -1, -1, -1, 111, -1, 111111, -1, 11111, -1
Offset: 1

Views

Author

V. Raman, Sep 07 2012

Keywords

Comments

a(n) = -1 if and only if n is a multiple of 2 or 5. See comment in A216485. - Chai Wah Wu, Jun 21 2015

Crossrefs

Cf. A084681 (number of 1's), A190301 (multiplier).

Programs

  • Mathematica
    Array[Which[GCD[#, 10] != 1, -1, Mod[#, 3] == 0, Block[{k = 1}, While[Mod[k, #] != 0, k = 10 k + 1]; k], True, (10^MultiplicativeOrder[10, #] - 1)/9] &, 42] (* Michael De Vlieger, Dec 11 2020 *)
  • Python
    def A216479(n):
        if n % 2 == 0 or n % 5 == 0:
            return -1
        rem = 1
        while rem % n != 0:
            rem = rem*10 + 1
        return rem
    # Azanul Haque, Nov 28 2020