Skip to main content
added 2 characters in body
Source Link
Dr. belisarius
  • 116.2k
  • 13
  • 205
  • 456

An easy way, using PowersRepresentations[]:

$PowersRepresentations[n,k,p] $ gives the distinct representations of the integer n as a sum of k non-negative p^th integer powers.

s1 = Join@@ (Select[PowersRepresentations[748,#,2], # ⋂ Range@16 == # &] & /@ Range@8)

Gives all possible ways to total 748.

For filtering the ones that are complementarycomplementaries:

s = Tally[s1, Union[#1, #2] == Range@16 &][[All, 1]];
Length@s
(*
 57
*)

An easy way, using PowersRepresentations[]:

$PowersRepresentations[n,k,p] $ gives the distinct representations of the integer n as a sum of k non-negative p^th integer powers.

s1 = Join@@ (Select[PowersRepresentations[748,#,2], # ⋂ Range@16 == # &] & /@ Range@8)

Gives all possible ways to total 748.

For filtering the ones that are complementary:

s = Tally[s1, Union[#1, #2] == Range@16 &][[All, 1]];
Length@s
(*
 57
*)

An easy way, using PowersRepresentations[]:

$PowersRepresentations[n,k,p] $ gives the distinct representations of the integer n as a sum of k non-negative p^th integer powers.

s1 = Join@@ (Select[PowersRepresentations[748,#,2], # ⋂ Range@16 == # &] & /@ Range@8)

Gives all possible ways to total 748.

For filtering the ones that are complementaries:

s = Tally[s1, Union[#1, #2] == Range@16 &][[All, 1]];
Length@s
(*
 57
*)
deleted 13 characters in body
Source Link
Dr. belisarius
  • 116.2k
  • 13
  • 205
  • 456

An easy way, using PowersRepresentations[]:

$PowersRepresentations[n,k,p] $ gives the distinct representations of the integer n as a sum of k non-negative p^th integer powers.

s1 = Join@@ (Select[PowersRepresentations[748,#,2], Intersection[#,# Range@16]⋂ Range@16 == # &] & /@ Range@8)

Gives all possible ways to total 748.

For filtering the ones that are complementary:

s = Tally[s1, Union[#1, #2] == Range@16 &][[All, 1]];
Length@s
(*
 57
*)

An easy way, using PowersRepresentations[]:

$PowersRepresentations[n,k,p] $ gives the distinct representations of the integer n as a sum of k non-negative p^th integer powers.

s1 = Join@@ (Select[PowersRepresentations[748,#,2], Intersection[#, Range@16] == # &] & /@ Range@8)

Gives all possible ways to total 748.

For filtering the ones that are complementary:

s = Tally[s1, Union[#1, #2] == Range@16 &][[All, 1]];
Length@s
(*
 57
*)

An easy way, using PowersRepresentations[]:

$PowersRepresentations[n,k,p] $ gives the distinct representations of the integer n as a sum of k non-negative p^th integer powers.

s1 = Join@@ (Select[PowersRepresentations[748,#,2], # ⋂ Range@16 == # &] & /@ Range@8)

Gives all possible ways to total 748.

For filtering the ones that are complementary:

s = Tally[s1, Union[#1, #2] == Range@16 &][[All, 1]];
Length@s
(*
 57
*)
added 9 characters in body
Source Link
Dr. belisarius
  • 116.2k
  • 13
  • 205
  • 456

An easy way, using PowersRepresentations[]:

$PowersRepresentations[n,k,p] $ gives the distinct representations of the integer n as a sum of k non-negative p^th integer powers.

s1 = Join@@ (Select[PowersRepresentations[748,#,2], Intersection[#, Range@16] == # &] & /@ Range@8)

Gives all possible ways to total 748.

For filtering the complementary ones that are complementary:

s = Tally[s1, Union[#1, #2] == Range@16 &][[All, 1]];
Length@s
(*
 57
*)

An easy way, using PowersRepresentations[]:

$PowersRepresentations[n,k,p] $ gives the distinct representations of the integer n as a sum of k non-negative p^th integer powers.

s1 = Join@@ (Select[PowersRepresentations[748,#,2], Intersection[#, Range@16] == # &] & /@ Range@8)

Gives all possible ways to total 748.

For filtering the complementary ones:

s = Tally[s1, Union[#1, #2] == Range@16 &][[All, 1]];
Length@s
(*
 57
*)

An easy way, using PowersRepresentations[]:

$PowersRepresentations[n,k,p] $ gives the distinct representations of the integer n as a sum of k non-negative p^th integer powers.

s1 = Join@@ (Select[PowersRepresentations[748,#,2], Intersection[#, Range@16] == # &] & /@ Range@8)

Gives all possible ways to total 748.

For filtering the ones that are complementary:

s = Tally[s1, Union[#1, #2] == Range@16 &][[All, 1]];
Length@s
(*
 57
*)
added 138 characters in body
Source Link
Dr. belisarius
  • 116.2k
  • 13
  • 205
  • 456
Loading
added 94 characters in body
Source Link
Dr. belisarius
  • 116.2k
  • 13
  • 205
  • 456
Loading
added 8 characters in body
Source Link
Dr. belisarius
  • 116.2k
  • 13
  • 205
  • 456
Loading
Source Link
Dr. belisarius
  • 116.2k
  • 13
  • 205
  • 456
Loading