A069570 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.
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, 29, 41, 42, 43, 44, 45, 46, 47, 48, 49, 61, 62, 63, 64, 65, 66, 67, 68, 69, 81, 82, 83, 84, 85, 86, 87, 88, 89, 111, 112, 113, 114, 115, 116, 117, 118, 119, 121, 122, 123, 124, 125
Offset: 1
Examples
The only restriction on the units digit is that it is nonzero. Therefore all single-digit numbers are included. 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. More generally, the second digit from the right ("10s digit") must be 1 or even. Similarly, the third digit from the right must be 1, 3 6 or 9. As all repunits are in the sequence, the sequence is infinite.
Crossrefs
Cf. A069571.
Programs
-
Mathematica
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 *)
-
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
-
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
-
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
Formula
a(n) % 10 = (n-1) % 9 + 1. - M. F. Hasler, Sep 27 2016
Extensions
Corrected (inserted missing terms) and extended by Jeremy Gardiner, Jun 17 2010
Definition clarified by M. F. Hasler, Sep 27 2016
Comments