A075018 Smallest k such that the concatenation k, k-1,k-2,k-3 is divisible by n; or 0 if no such number exists.
3, 3, 3, 5, 3, 3, 5, 5, 6, 3, 18, 9, 11, 5, 3, 15, 13, 15, 19, 23, 18, 29, 29, 15, 28, 11, 33, 5, 4, 3, 40, 15, 18, 13, 18, 15, 28, 19, 24, 23, 26, 39, 7, 51, 33, 29, 55, 15, 53, 53, 30, 63, 54, 33, 18, 5, 57, 41, 56, 63, 69, 71, 60, 15, 63
Offset: 1
Examples
a(7) = 5 as 7 divides 5432.
Programs
-
Mathematica
Transpose[Flatten[Table[Select[Reverse[Partition[Range[100,0,-1], 4,1]], Divisible[FromDigits[ Flatten[IntegerDigits/@#]],n]&,1],{n,70}],1]] [[1]] (* Harvey P. Dale, Nov 22 2011 *)
Extensions
Corrected and extended by Antonio G. Astudillo (afg_astudillo(AT)lycos.com), Apr 19 2003