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.

A175389 Smallest nonnegative number k such that 2^k contains n, 2n and 3n as substrings of its decimal expansion.

Original entry on oeis.org

10, 17, 18, 29, 50, 87, 86, 31, 70, 62, 101, 147, 86, 124, 93, 144, 82, 81, 157, 113, 100, 110, 146, 110, 88, 96, 141, 158, 94, 69, 79, 75, 123, 244, 192, 297, 181, 168, 128, 255, 101, 140, 197, 182, 147, 228, 111, 189, 224, 303, 288, 510, 321, 289, 232, 432, 342
Offset: 0

Views

Author

Zak Seidov, Apr 27 2010

Keywords

Examples

			2^10 = 1024 is the smallest power of 2 containing a 0, so a(0) = 10.
2^101 = 2535301200456458802993406410752 is the smallest power of 2 containing 10, 20, and 30 as substrings, so a(10) = 101.
		

Crossrefs

Cf. A030000 (Susanna's sequence: smallest nonnegative number k such that 2^k contains n).

Programs

  • Maple
    N:= 100: # to get a(0) to a(N)
    R:= 'R': count:= 0:
    for k from 0 while count < N+1 do
       t:= 2^k;
       d:= ilog10(t);
       V:= select(`<=`,{seq(seq(floor(t/10^i) mod 10^j, j=1..d+1-i),
          i=0..d)},3*N);
       V3:= select(t -> t <= N and has(V,2*t) and has(V,3*t), V);
       for v in V3 do
         if not assigned(R[v]) then
           count:= count+1;
           R[v]:= k;
         fi
       od;
    od:
    seq(R[n],n=0..N); # Robert Israel, Jul 19 2016
  • Mathematica
    Table[SelectFirst[Range[0, 10^3], Function[k, Length@ DeleteCases[
    Map[SequencePosition[IntegerDigits[2^k], IntegerDigits@ #] &, n Range@ 3] /. {} -> 0, m_ /; m == 0] == 3]], {n, 0, 56}] (* Michael De Vlieger, Jul 19 2016, Version 10.1 *)