|
|
A047726
|
|
Number of different numbers that are formed by permuting digits of n.
|
|
27
|
|
|
1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 3, 3, 6
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,10
|
|
COMMENTS
|
|
|
LINKS
|
|
|
FORMULA
|
|
|
EXAMPLE
|
From 102 we get 102, 120, 210, 201, 12 and 21, so a(102)=6.
From 33950 with 5 digits, one '0', two '3', one '5' and one '9', we get 5! / (1! * 2! * 1! * 1!) = 60 different numbers and a(33950) = 60. - Bernard Schott, Oct 20 2019
|
|
MAPLE
|
f:= proc(n) local L;
L:= convert(n, base, 10);
nops(L)!/mul(numboccur(i, L)!, i=0..9);
end proc:
|
|
MATHEMATICA
|
pd[n_]:=Module[{p=Permutations[IntegerDigits[n]]}, Length[Union [FromDigits/@p]]]; pd/@Range[120] (* Harvey P. Dale, Mar 22 2011 *)
|
|
PROG
|
(Haskell)
import Data.List (permutations, nub)
a047726 n = length $ nub $ permutations $ show n
(PARI) a(n)=n=eval(Vec(Str(n))); (#n)!/prod(i=0, 9, sum(j=1, #n, n[j]==i)!) \\ Charles R Greathouse IV, Sep 29 2011
(PARI) A047726(n)={local(c=Vec(0, 10)); apply(d->c[d+1]++, digits(n)); logint(n*10, 10)!/prod(i=1, 10, c[i]!)} \\ M. F. Hasler, Oct 18 2019
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,easy,base,nice
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|