Problem 58019. Factor a number into Fermi-Dirac primes
Solution Stats
Problem Comments
-
4 Comments
Ramon's solutions under 49 used pyrun() calls I don't even pretend to understand. My 36 post is straight MATLAB, though I admit I used str2num() rather strongly.
What should be the output for numbers such as 256?
[4 64]? [16 16]?
Or 1024?
[4 256]? [4 4 64]? [4 4 4 16]? [16 64]? [4 16 16]?
Does it have to be a particular pairing(s)? If yes, how so?
Or will any/all of them work?
@Dyuman Here's my two cents:
256 = [256]. [4 64] is not valid since 64 is not a prime power where the exponent is a power of two. [16 16] is out since - I assume - you're supposed to simplify as much as possible. Same for [2 2 2 2 2 2 2 2], [4 4 4 4] and so on. But you're right that this additional requirement is needed to ensure uniqueness.
1024 = [4 256] using the same reasoning.
I added the requirement that the FD primes appear in the factorization at most once. This requirement resembles a difference between the Fermi-Dirac and the Bose-Einstein distributions of particles.
Solution Comments
Show commentsProblem Recent Solvers8
Suggested Problems
-
Remove any row in which a NaN appears
8643 Solvers
-
89 Solvers
-
143 Solvers
-
Return fibonacci sequence do not use loop and condition
686 Solvers
-
Matrix of almost all zeros, except for main diagonal
183 Solvers
More from this Author289
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!