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.
%I A381526 #16 Mar 03 2025 13:36:48 %S A381526 -1,1,-1,5,-1,5,2,5,-1,5,1,1,1,1,1,1,1,1,1,1,-1,1,9,5,72,5,2,5,6,5,5, %T A381526 1,91,5,42,4,2,4,36,5,-1,1,94,5,3,3,2,5,8,5,5,1,24,5,7,5,2,5,21,5,2,1, %U A381526 2,2,2,5,2,5,7,5,5,1,484,5,47,5,2,3,3,3,-1 %N A381526 a(n) is the smallest positive integer k such that the decimal expansion of k is a substring of the decimal expansion of n*k, or -1 if no such number exists. %H A381526 Dominic McCarty, <a href="/A381526/b381526.txt">Table of n, a(n) for n = 0..10000</a> %H A381526 Dominic McCarty, <a href="/A381526/a381526.txt">Proof that a(2) = a(4) = a(8) = -1</a> %F A381526 a(10*n) = a(n). %F A381526 a(n) = A381527(n)/n for A381527(n) != -1. %e A381526 44*1 = 44 does not have 1 as a substring. %e A381526 44*2 = 88 does not have 2 as a substring. %e A381526 44*3 = 132 has 3 as a substring. %e A381526 So, a(44) = 3. %o A381526 (Python) %o A381526 from itertools import count %o A381526 def a(n): %o A381526 if n in [0, 2, 4, 8]: return -1 %o A381526 if n % 10 == 0: return a(n//10) %o A381526 for k in count(1): %o A381526 if str(k) in str(k*n): return k %o A381526 print([a(n) for n in range(100)]) %o A381526 (PARI) a(n) = if ((n==0) || (n==2) || (n==4) || (n==8), return(-1)); if (n%10, my(k=1); while (#strsplit(Str(n*k), Str(k)) < 2, k++); k, a(n/10)); \\ _Michel Marcus_, Feb 26 2025 %Y A381526 Cf. A381527 (for n*a(n)), A381528 (records), A239134, A337084. %K A381526 sign,base,easy,look %O A381526 0,4 %A A381526 _Dominic McCarty_, Feb 26 2025