Tag Info

Hot answers tagged

4

Edit: Since now even I have understood the reasoning of the elf requiring more information because after measuring the tree the solution is not unique, I can give a full implementation too. When n is the magical number 2450, then we can create all possibilities with Union[Sort /@ Select[Tuples[Divisors[n], {3}], Times @@ # === n &]] Now, what's ...


3

Perhaps shorter: << Combinatorica` factors = Join @@ ConstantArray @@@ FactorInteger@2450; toWork = {#, Tr@#} & /@ (Sort /@ Apply[Times, KSetPartitions[factors, 3], {2}] // Union) Sort[First[Transpose @@ Select[GatherBy[toWork, Last], Length@# == 2 &]], Max] // First (* {5, 10, 49} *)


2

Short, but barely shorter than halirutan's. And much uglier. And it assumes that Santa is less than 100 years old. But I'm posting it anyway: n = 2450; Cases[IntegerPartitions[#,{3},Divisors@n]~Cases~ {x__/;1x==n}&/@Range@100,x:{_,__}:>x~MinimalBy~Max->Max@x]


2

I don't have a general approach but in a world where 19 and x^4+23 define our number field, a decomposition can be found by factoring the polynomial. InputForm[Factor[x^4+23,Modulus->19]] (* Out[3]//InputForm= (2 + 2*x + x^2)*(2 + 17*x + x^2) *) The upshot is that the ideal <19,x^4+23> in Z[x] is the ...



Only top voted, non community-wiki answers of a minimum length are eligible