%I
%S 1,2,3,4,5,6,7,8,9,11,12,13,14,15,16,17,18,19,21,22,23,24,25,26,27,28,
%T 29,41,42,43,44,45,46,47,48,49,61,62,63,64,65,66,67,68,69,81,82,83,84,
%U 85,86,87,88,89,111,112,113,114,115,116,117,118,119,121,122,123,124,125
%N Numbers n in which the k-th digit (counted from the right) is nonzero and either a divisor or a multiple of k, for all 1 <= k <= number of digits of n.
%C The units digits are 1, ..., 9 repeating (period 9). From n = 10 on, the 10's digits are { 1, 2, 4, 6, 8 } each repeated 9 times, and then starting over with 1. Similarly, starting with the first 3-digit term, the 100's digits are {1, 3, 6, 9}, each repeated 45 times, then starting over with 1. From the first 4-digit term on, the 1000's digits are { 1, 2, 4, 8 }, each repeated 180 times, then starting over with 1, etc. - _M. F. Hasler_, Sep 27 2016
%F a(n) % 10 = (n-1) % 9 + 1. - _M. F. Hasler_, Sep 27 2016
%e The only restriction on the units digit is that it is nonzero. Therefore all single-digit numbers are included.
%e 23 is a term because the 1st digit from the right is 3 which is a multiple of 1, and the 2nd digit from the right is 2 which is a multiple and also divisor of 2.
%e More generally, the second digit from the right ("10s digit") must be 1 or even.
%e Similarly, the third digit from the right must be 1, 3 6 or 9.
%e As all repunits are in the sequence, the sequence is infinite.
%t Select[Range@ 125, Times @@ Map[Boole, MapIndexed[If[#1 == 0, False, Total@ Boole@ {First@ Divisible[#2, #1], First@ Divisible[#1, #2]} > 0] &, Reverse@ IntegerDigits@ #]] > 0 &] (* _Michael De Vlieger_, Sep 27 2016 *)
%o (PARI) select( is(n)=!for(i=1,#n=Vecrev(digits(n)),(!n[i]||(n[i]%i&&i%n[i]))&&return), [1..125]) \\ _M. F. Hasler_, Sep 27 2016
%o (PARI) is(n) = {my(d = digits(n)); for(i=1,#d, m=min(d[#d+1-i], i); if(m==0, return(0)); if((d[#d+1-i] + i)%m!=0,return(0)));1} \\ _David A. Corneth_, Sep 27 2016
%o (PARI) A069570(n,s,k,d)={until(!n\=#d,s+=10^(k++-1)*(d=select(d->!(k%d&&d%k),[1..9]))[n--%#d+1]);s} \\ _M. F. Hasler_, Sep 28 2016
%Y Cf. A069571.
%K nonn,base
%O 1,2
%A _Amarnath Murthy_, Mar 24 2002
%E Corrected (inserted missing terms) and extended by _Jeremy Gardiner_, Jun 17 2010
%E Definition clarified by _M. F. Hasler_, Sep 27 2016
|