|
|
A091853
|
|
a(n) is the number of numbers k such that k is obtained by permuting the digits of n and gcd(n,k) > 1.
|
|
2
|
|
|
0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 2, 2, 1, 1, 2, 1, 2, 2, 2, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 2, 2, 1, 2, 1, 1, 2, 2, 1, 2, 1, 2, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 2, 2, 2, 1, 1, 1, 2, 2, 2, 1, 2, 1, 1, 2, 1, 1, 2, 1, 2, 2, 2, 1, 2, 1, 2, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 1, 2, 1, 6, 1, 4, 6
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
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
|
|
|
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
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|