login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

Product of all numbers formed by permuting the digits of n.
1

%I #2 Mar 30 2012 17:27:32

%S 0,1,2,3,4,5,6,7,8,9,10,121,252,403,574,765,976,1207,1458,1729,40,252,

%T 484,736,1008,1300,1612,1944,2296,2668,90,403,736,1089,1462,1855,2268,

%U 2701,3154,3627,160,574,1008,1462,1936,2430,2944,3478,4032,4606,250

%N Product of all numbers formed by permuting the digits of n.

%C Differs from A062003 at those n which have more than two digits.

%e a(10) = 10*01 = 10, a(11) = 11*11 = 121, a(12) = 12*21 =252.

%o (ARIBAS): function permute(s: string): array; var i,k: integer; st1,st2: stack; ele,ws: string; begin stack_push(st2,s[0..0]); for i := 1 to length(s)-1 do while not stack_empty(st2) do stack_push(st1,stack_pop(st2)); end; ele := s[i]; while length(st1) > 0 do ws := stack_pop(st1); for k := 0 to length(ws)-1 do stack_push(st2,concat(ws[0..k-1],ele,ws[k..])); end; stack_push(st2,concat(ws[0..],ele)); end; end; return stack2array(st2); end; function int_permute(n: integer): array; var s: string; ar: array; i: integer; begin s := itoa(n); ar := permute(s); for i := 0 to length(ar)-1 do ar[i] := atoi(ar[i]); end; return ar; end; for k := 0 to 55 do write(product(int_permute(k))," "); end;

%Y A061147, A062003.

%K base,easy,nonn

%O 0,3

%A _Klaus Brockhaus_, Jun 08 2001