Tag Info

New answers tagged

3

SumFact[n_: Integer] := Apply[Plus, Map[#[[1]] #[[2]] &, FactorInteger[n]]]; A = {}; lastFac = SumFact[10^7 - 1]; Do[ If[(z = SumFact[n]) == lastFac, AppendTo[A, n]]; lastFac = z, {n, 10^7 + 1, 10^8, 2}]; A This took about 15 minutes on my MacPro and gave 417 candidates. There should be no problem parallelizing this code and getting up to n = ...


1

You could always use brute force: max = 10^12; ( sq2 = Range[Floor[Sqrt[max/2]]]^2; sq2 = sq2[[2 ;;]] + sq2[[ ;; -2]]; sq3 = Range[Floor[Sqrt[max/3]]]^2; sq3 = sq3[[3 ;;]] + sq3[[2 ;; -2]] + sq3[[;; -3]]; Intersection[sq2, sq3] ) // Timing {0.046800, {365, 35645, 3492725, 342251285, 33537133085}} Not as elegant as the others, but quite ...


0

Solutions can be greatly simplified simply computing the next number. For the equation: $$n^2+(n+1)^2=k^2+(k+1)^2+(k+2)^2$$ Using the first number. $(p_1 ; s_1) - (1 ; 0 )$ Let's use these numbers. Which are the sequence. The following is found using the previous value according to the formula. $$p_2=5p_1+12s_1$$ $$s_2=2p_1+5s_1$$ Using the ...


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]


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} *)


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 ...


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 ...



Top 50 recent answers are included