

A331475


a(n) is the smallest ndigit number using each digit 0 to n1 once, such that the numbers formed by its last k digits are divisible by k, (k = 1..n).


1




OFFSET

1,2


COMMENTS

a(n) = A147636(n) for n=1, 2, 3, 9 and 10.


LINKS

Table of n, a(n) for n=1..10.


EXAMPLE

a(3) = 3012 because 2, 12, 012, 3012 are divisible by 1, 2, 3, 4 and it is the least such number with distinct digits 0 to 3.


MATHEMATICA

ok[n_] := AllTrue[Range@ IntegerLength@ n, Mod[ Mod[n, 10^#], #] == 0 &]; a[n_] := SelectFirst[ FromDigits /@ Permutations[Range[0, n1]], # >= 10^(n1)  1 && ok[#] &]; Array[a, 10] (* Giovanni Resta, May 04 2020 *)


CROSSREFS

Cf. A147636, A158242, A220491.
Sequence in context: A061630 A062806 A336952 * A158240 A087393 A037596
Adjacent sequences: A331472 A331473 A331474 * A331476 A331477 A331478


KEYWORD

base,fini,full,nonn


AUTHOR

Eduardo P. Feitosa, May 03 2020


STATUS

approved



