Mathematica [Mathematica] Combining statements

  • Thread starter Thread starter martix
  • Start date Start date
  • Tags Tags
    Mathematica
AI Thread Summary
The discussion centers on the use of Mathematica functions to factor permutations of the digits 1-9 with a length of 4. The first two expressions successfully compute the factors of the number 1234 and the permutations of the digits, respectively. However, the third expression, which aims to apply the factorization to all permutations, does not work as intended. The correct approach involves using MapThread in conjunction with FromDigits and Permutations, ensuring that the factors are raised to their respective powers. A minor mistake in the syntax was identified, leading to the conclusion that the correct method should apply MapThread directly to the results of FromDigits applied to the permutations.
martix
Messages
167
Reaction score
5
FromDigits /@ Permutations[Range[9], {4}]

MapThread[Power, Transpose [FactorInteger[1234]]]

MapThread[Power, Transpose [FactorInteger[#]]] &[FromDigits /@ Permutations[Range[9], {4}]]

Expression 1 and 2 work, so why not 3?

General goal:
Find the factors of all permutations of the digits 1-9 with length 4(with the factors raised to their respective powers).
 
Physics news on Phys.org
Shouldn't it be:
MapThread[Power, Transpose [FactorInteger[#]]]& @ (FromDigits /@ Permutations[Range[9], {4}])
?
 
Indeed it should :) Thanks.
Minor mistake:
MapThread[Power, Transpose [FactorInteger[#]]]& /@ (FromDigits /@ Permutations[Range[9], {4}])
 

Similar threads

Replies
5
Views
3K
Replies
1
Views
2K
Replies
8
Views
2K
Replies
1
Views
2K
Replies
2
Views
2K
Replies
2
Views
2K
Replies
2
Views
3K
Replies
4
Views
3K
Replies
2
Views
2K
Back
Top