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.

A226219 Least k > 1 not a power of 10 such that n is a substring of k*n.

Original entry on oeis.org

2, 11, 6, 11, 6, 3, 6, 11, 6, 11, 11, 101, 26, 87, 51, 21, 26, 69, 51, 63, 6, 58, 51, 97, 26, 5, 51, 101, 26, 79, 11, 101, 26, 101, 51, 21, 26, 101, 51, 87, 6, 59, 34, 101, 26, 21, 51, 74, 26, 51, 3, 69, 26, 29, 51, 21, 26, 101, 51, 27, 6, 92, 51, 26, 26, 21
Offset: 0

Views

Author

Paul Tek, May 31 2013

Keywords

Crossrefs

Cf. A045537.

Programs

  • Haskell
    import Data.List (isInfixOf, isPrefixOf)
    a226219 n = head [k | k <- [2..],
                          isInfixOf (show n) (show (k*n)), not $ p10 k]
       where p10 = flip isPrefixOf ('1' : repeat '0') . show  :: Int -> Bool
    -- Reinhard Zumkeller, May 31 2013
  • Mathematica
    Table[k = 2; While[IntegerQ[Log[10, k]] || StringPosition[ToString[k*n], ToString[n], 1] == {}, k++]; k, {n, 0, 100}] (* T. D. Noe, May 31 2013 *)
  • Perl
    sub a {
        my $n = shift;
        my $k = 2;
        while (1) {
            if ($k !~ /^10+$/) {
                if (index($k*$n, $n)>=0) {
                    return $k;
                }
            }
            $k++;
        }
    }
    

Formula

a(n) <= 10^A055642(n)+1.