Carl Love

Carl Love

28100 Reputation

25 Badges

13 years, 104 days
Himself
Wayland, Massachusetts, United States
My name was formerly Carl Devore.

MaplePrimes Activity


These are replies submitted by Carl Love

@tomleslie It is only repeatedly recreating the list that is inefficient. Kitonum's first solution, using map, only recreates it once.

@Oak Staff It would take me writing a book to explain things at the level that you need. I suggest that you start with a beginner's book on computer programming in Python. Pay particular attention to any material dealing with procedures, functions, or recursion. IMO, Python is the freely available language that is most like Maple. Then read the Maple help pages such as ?proc, ?Statistics,Tally, ?table, ?nops, ?add, ?remember, ?elementwise, ?thisproc, ?list, ?local, ?if, and ?indices. Then move on to the Maple Programming Guide. The whole book is available through Maple's onboard help system.

@Kitonum Your second method, the modification of the OP's code, involves recreating the whole list for each distinct negative entry. That'll be quite inefficient for a long list.

@adel-00 I only translated the code. I don't have any overall understanding of it.

@adel-00 Yes, I can translate this into Maple. It'll be a few hours though.

I've copied the original Question here so that you can't erase it:

I'm trying to write a procedure that computes Pollard's P-1 Method for a given integer n, and then outputs the prime factorisation of n.

Here is what I have so far:

Pollard := proc (n)
local i, r, g;
r[1] := `mod`(2^factorial(2), n);
for i from 2 while gcd(`mod`(r[i-1]-1, n), n) = 1 do
r[i] := `mod`(2^factorial(i+1), n) end do;
g[i] := gcd(`mod`(r[i-1]-1, n), n);
if g[i] < n then return g[i]
else return n
end if
end proc;

But my procedure doesn't seem to work for a lot of large values for n.
And also I can't figure out how to make it actually output the factorisation.

Any help would be appreciated.

Now you've deleted your responses!! That's almost as bad!

Thank you for restoring the Question and thus restoring my faith in humanity. If you now post the queue question, I'll answer it forthwith.

@asa12 An equation of the form H(x) + H(y) = H(x+y) is called a functional equation. As far as I know, Maple has no facility whatsoever for solving functional equations. I also have not heard of any other software for it.

You erased your original Question after it was Answered. That is a major no-no. Major. Please put back the original Question and especially its title (or something close to them), and ask the above as a separate and new Question. I won't answer any of your questions until you take care of this.

Even if they're not ASCII, they're still printable characters; so, does it really matter?

If it does matter, then group them into groups of 7 bits instead of 8.

If you can find the algorithm for it, I'll code it in Maple.

Update: I've found an algorithm, and I'm working on it.

Update 2: I've finished coding the algorithm, but before I post it, please provide some two-dimensional data for me the test it on.

@peter2108 In the same place that there is the button to Vote Up the Answer, there is also a button that looks like a trophy cup. You can use that button to select an Answer as the Best Answer to your Question. I think that using that button doesn't require any reputation points.

@marc sancandi In the absence of any statement to the contrary, I think that it's reasonable to assume that the OP wanted a uniform distribution over all 21 pairs (x,y) such that 1 <= x < y <= 7. I don't see how you can say a priori that one distribution is "right" and the other "wrong"---it all depends on what is desired. 

@torabi Yes, Maple has no numeric solver for elliptic PDEs. You're out of luck.

First 431 432 433 434 435 436 437 Last Page 433 of 709