#Mathematica, 53 bytes
Mathematica, 53 bytes
Min[Plus@@@Table[$($+1)/2,{,ドル#+1}]~FrobeniusSolve~#]&
This code is very slow. If you want to test this function, use the following version instead:
Min[Plus@@@Table[$($+1)/2,{,ドル√#+1}]~FrobeniusSolve~#]&
###Explanation
Explanation
Min[Plus@@@Table[$($+1)/2,{,ドル#+1}]~FrobeniusSolve~#]& (* input: n *)
Table[$($+1)/2,{,ドル#+1}] (* Generate the first n triangle numbers *)
~FrobeniusSolve~# (* Generate a Frobenius equation from the *)
(* triangle numbers and find all solutions. *)
Plus@@@ (* Sum each solution set *)
Min (* Fetch the smallest value *)
#Mathematica, 53 bytes
Min[Plus@@@Table[$($+1)/2,{,ドル#+1}]~FrobeniusSolve~#]&
This code is very slow. If you want to test this function, use the following version instead:
Min[Plus@@@Table[$($+1)/2,{,ドル√#+1}]~FrobeniusSolve~#]&
###Explanation
Min[Plus@@@Table[$($+1)/2,{,ドル#+1}]~FrobeniusSolve~#]& (* input: n *)
Table[$($+1)/2,{,ドル#+1}] (* Generate the first n triangle numbers *)
~FrobeniusSolve~# (* Generate a Frobenius equation from the *)
(* triangle numbers and find all solutions. *)
Plus@@@ (* Sum each solution set *)
Min (* Fetch the smallest value *)
Mathematica, 53 bytes
Min[Plus@@@Table[$($+1)/2,{,ドル#+1}]~FrobeniusSolve~#]&
This code is very slow. If you want to test this function, use the following version instead:
Min[Plus@@@Table[$($+1)/2,{,ドル√#+1}]~FrobeniusSolve~#]&
Explanation
Min[Plus@@@Table[$($+1)/2,{,ドル#+1}]~FrobeniusSolve~#]& (* input: n *)
Table[$($+1)/2,{,ドル#+1}] (* Generate the first n triangle numbers *)
~FrobeniusSolve~# (* Generate a Frobenius equation from the *)
(* triangle numbers and find all solutions. *)
Plus@@@ (* Sum each solution set *)
Min (* Fetch the smallest value *)
#Mathematica, 53 bytes
Min[Plus@@@Table[$($+1)/2,{,ドル#+1}]~FrobeniusSolve~#]&
This code is very slow. If you want to test this function, use the following version instead:
Min[Plus@@@Table[$($+1)/2,{,ドル√#+1}]~FrobeniusSolve~#]&
###Explanation
Min[Plus@@@Table[$($+1)/2,{,ドル#+1}]~FrobeniusSolve~#]& (* input: n *)
Table[$($+1)/2,{,ドル#+1}] (* Generate the first n triangle numbers *)
~FrobeniusSolve~# (* Generate a Frobenius equation from the *)
(* triangle numbers and find all solutions. *)
Plus@@@ (* Sum each solution set *)
Min (* Fetch the smallest value *)
#Mathematica, 53 bytes
Min[Plus@@@Table[$($+1)/2,{,ドル#+1}]~FrobeniusSolve~#]&
#Mathematica, 53 bytes
Min[Plus@@@Table[$($+1)/2,{,ドル#+1}]~FrobeniusSolve~#]&
This code is very slow. If you want to test this function, use the following version instead:
Min[Plus@@@Table[$($+1)/2,{,ドル√#+1}]~FrobeniusSolve~#]&
###Explanation
Min[Plus@@@Table[$($+1)/2,{,ドル#+1}]~FrobeniusSolve~#]& (* input: n *)
Table[$($+1)/2,{,ドル#+1}] (* Generate the first n triangle numbers *)
~FrobeniusSolve~# (* Generate a Frobenius equation from the *)
(* triangle numbers and find all solutions. *)
Plus@@@ (* Sum each solution set *)
Min (* Fetch the smallest value *)
#Mathematica, 53 bytes
Min[Plus@@@Table[$($+1)/2,{,ドル#+1}]~FrobeniusSolve~#]&