Message Boards Message Boards

Slow calculation for PowersRepresentations in ParallelTable

Posted 2 years ago

Well, I have the following code:

Clear["Global`*"];
a =;
b =;
\[Alpha] =;
\[Beta] =;
k =;
ParallelTable[
  If[TrueQ[Length[
      Select[PowersRepresentations[n, a, b], 
       DuplicateFreeQ[#] && ! MemberQ[#, 0] &]] >= k], n, 
   Nothing], {n, \[Alpha], \[Beta]}] //. {} -> Nothing

But for a given $a,b, k,\alpha$ and $\beta$ this calculation is really slow. Is there a way to speed things up a bit?

I am a student in elementary number theory and looking for power representations of certain numbers. For relatively small sets, it is convenient to use this code but for larger sets, it becomes way too slow.

Thanks for any advice and help.


Example runnable code:

Clear["Global`*"];
a = 3;
b = 5;
\[Alpha] = 500000;
\[Beta] = 10000000;
k = 6;
ParallelTable[
  If[TrueQ[Length[
      Select[PowersRepresentations[n, a, b], 
       DuplicateFreeQ[#] && ! MemberQ[#, 0] &]] >= k], n, 
   Nothing], {n, \[Alpha], \[Beta]}] //. {} -> Nothing
POSTED BY: Jan Eerland
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract