login
Smallest multiple of the n-th prime not containing any of its digits, or 0 if no such number exists.
2

%I #13 Jul 21 2020 10:33:56

%S 4,6,10,14,22,26,34,38,46,58,62,111,82,86,188,106,118,244,134,284,146,

%T 158,166,267,388,2222,824,428,327,226,508,262,548,278,2086,302,628,

%U 489,334,692,358,362,382,772,2364,2388,633,446,454,458,466,478,3856,4769

%N Smallest multiple of the n-th prime not containing any of its digits, or 0 if no such number exists.

%C a(n) = 0 if and only if prime(n) contains all decimal digits with the possible exception of 0. Otherwise, if n > 3 and p=prime(n) does not contain the nonzero digit k, the repdigit (10^m-1)*k/9 is a multiple of p where m is the order of 10 mod p. - _Robert Israel_, Jul 21 2020

%H Robert Israel, <a href="/A076924/b076924.txt">Table of n, a(n) for n = 1..10000</a>

%F a(n) = A074157(prime(n)). - _Robert Israel_, Jul 21 2020

%p f:= proc(n) local p, k,r,D;

%p D:= convert(convert(n,base,10),set);

%p for k from 2 to 10^(1+ilog10(n)) do

%p r:= k*n;

%p if convert(convert(r,base,10),set) intersect D = {} then return r fi

%p od;

%p error ("search failed for n=%1",n)

%p end proc:

%p seq(f(ithprime(i)),i=1..100); # _Robert Israel_, Jul 21 2020

%t smp[p_]:=Module[{k=2},While[ContainsAny[IntegerDigits[k*p], IntegerDigits[ p]],k++];k*p]; Table[smp[p],{p,Prime[Range[60]]}] (* Requires Mathematica version 10 or later *) (* _Harvey P. Dale_, Nov 19 2019 *)

%Y Cf. A074157, A076925.

%K base,nonn

%O 1,1

%A _Amarnath Murthy_, Oct 17 2002

%E Corrected and extended by _Ray Chandler_, Feb 11 2005