OFFSET
1,12
COMMENTS
For a number like 12345 which is a multiple of three and does not contain zero, all 5! = 120 permutations yield a distinct number divisible by 3, thus a(12345) = 120. However, 120 occurs for the first time at n = 10236, which is also a multiple of three. - Antti Karttunen, Dec 16 2017
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..12345
EXAMPLE
1 is the only number obtained by permuting the digits of 1, gcd(1,1) = 1, hence a(1) = 0.
001, 010, 100 are the numbers obtained by permuting the digits of 100, gcd(100,1) = 1, gcd(100,10) = 10, gcd(100,100) = 100, hence a(100) = 2.
MATHEMATICA
Table[Count[Union@ Map[# Boole[! CoprimeQ[#, n]] &@ FromDigits@ # &, Permutations@ IntegerDigits@ n], _?(# > 0 &)], {n, 105}] (* Michael De Vlieger, Dec 16 2017 *)
PROG
(PARI) A091853(n) = { my(digs=digits(n), nd=length(digs), k, p, s = Set([])); for(j=0, nd!-1, p=numtoperm(nd, j); if(1<gcd(n, k=fromdigits(vector(nd, i, digs[p[i]]))), s = setunion(Set([k]), s))); length(s); }; \\ Antti Karttunen, Dec 16 2017
CROSSREFS
KEYWORD
AUTHOR
Amarnath Murthy, Mar 13 2004
EXTENSIONS
Edited, corrected and extended by Klaus Brockhaus, Mar 16 2004
STATUS
approved