%I #11 Feb 02 2024 20:07:41
%S 2,4,6,8,21,24,27,42,45,48,60,63,66,69,81,84,87,210,215,240,245,270,
%T 275,420,425,450,455,480,485,600,605,630,635,660,665,690,695,810,815,
%U 840,845,870,875,2100,2107,2156,2401,2408,2450,2457,2702,2709,2751,2758
%N Numbers n in which the first K digits of n form an integer divisible by the K-th prime, for K = 1, 2, ..., M, where M is the number of digits in n.
%C There are 200 terms in the sequence and 10-digit number 8757193191 is the largest number to satisfy the requirements. - _Shyam Sunder Gupta_, Aug 04 2013
%H Shyam Sunder Gupta, <a href="/A079206/b079206.txt">Table of n, a(n) for n = 1..200</a>
%H <a href="http://www.contestcen.edu/digits.htm">Divisible by Primes</a> (missing)
%e a(88)=21076 because 2 is divisible by the first prime 2, 21 by the second prime 3, 210 by the third prime 5, 2107 by the fourth prime 7, 21076 by the fifth prime 11.
%t a = Table[j, {j, 2, 8, 2}]; r = 2; t = a; While[! a == {}, n = Length[a]; k = 1; b = {}; While[! k > n, z0 = a[[k]]; Do[z = 10*z0 + j; If[Mod[z, Prime[r]] == 0, b = Append[b, z]; t = Append[t, z]], {j, 0, 9}]; k++]; a = b; r++]; t (* _Shyam Sunder Gupta_, Aug 04 2013 *)
%o (Python)
%o P, R, m = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37], [2, 4, 6, 8], 1
%o a = R[:]
%o while len(R) > 0:
%o R = [t for t in (10*q+d for q in R for d in range(10)) if t%P[m]==0]
%o a, m = a + R, m+1
%o print(a) # _Michael S. Branicky_, Feb 02 2024
%K base,fini,full,nonn
%O 1,1
%A Sudipta Das (juitech(AT)vsnl.net), Feb 03 2003