## 4855 Reputation

10 years, 215 days

## F5 to toggle between text and math and #...

If you're in document mode just use F5 to toggle between text and math input or if you're in worksheet mode use # sign to ignore text after it.

Search the maple application center I remember seeing a document in there about writing maple documents.  Ask google too.

## Probably not...

That's a good point.  I'll stick to Maple, I'm biased to it anyways.

## It's probably Error, unterminated loop...

I believe he means unterminated loop.  You're just missing an extra end do in that case.

## Maple programming resources...

You can find some resources at the maplesoft application center:

go here http://www.maplesoft.com/applications/view.aspx?SID=4744 for a complete set of Maple programming lessons.

Also here http://www.cs.drexel.edu/~jjohnson/fa01/asym/lectures/lec4.html - maple programming
or here http://www.cs.drexel.edu/~jjohnson/fa01/asym/lectures/lec5.html - advanced maple programming

Alternatively, you can go here for some basics http://theor.jinr.ru/Documents/MapleV/program/program.html ,old but still good.

I believe the two lectures above are related to this interesting course I found Algorithmic number theory and cryptography using maple http://www.cs.drexel.edu/~jjohnson/2008-09/spring/cs303.html#lectures

## My error - was a space after print and b...

Okay finally I found out why it wasn't working.  It was because I had a space between the print and (n,m).

As for my loop breaking out and continuing on, I came up with this.

restart:
for m from 1 to 100 do
for n from 1 to 355 do
if mod(n*m,355)=0 and n<>355 then print(n,m); break end if
end do
end do

The n<>355 is just to remove the trivial solutions and I couldn't figure out how to get it working with a counter.

## I'm stuck...

So I'm experimenting and I do this, nothing happens.  What's wrong with it?

restart:
for m from 1 to 5 do
for n from 1 to 5 do
if (n*m)>10 then print (n,m)
end if
end do
end do

BTW in your if statement I believe you meant end if.

## Curious...

Just curious, using my double loop how would I limit my output to show the only the first integer for each n?

Also how does one put counters in maple loops?  C programming is just a=a+1, not so with maple.  That is if I want to increment a value by 1 each time it cycles in the loop how would I do that?

## This might help some more...

restart:
for m from 1 to 100 do
for n from 1 to 355 do
if mod(n*m,355)=0 then print(n,m);
end if
end do
end do;

With m=199 the only answer is n=355 since it's the only integer from 1 to 355 where mod(n*199,355)=0

## simlar way - simplified M...

Thanks

Or I could simplify your M with

M:=rand(1..K)();

## Wolfram is numb3rs chief math consultant...

I'm not sure if mathematica is mentioned anywhere in the show but from wikipedia it states "Wolfram Research (the maker of Mathematica) is the chief math consultant, reviewing scripts and providing background mathematics for the show."

Thanks for the link correction, just take out the www in the address and it will work.  Here's the link:  http://numb3rs.wolfram.com I haven't had a good chance to fully read the links to each of the episodes, they seem to be done fairly well.

Maybe someone could start a numb3rs blog here at mapleprimes and make worksheets associated to each episode.

## Brute force, what about double digits?...

Okay thanks, I thought that's really the only way to do it.

Sorry to play a little bit of devils advocate but wouldn't double or even triple digit numbers work?

Something like 6997=7^(9+69) I know it's wrong and is not a solution but just as an example would such a solution exist?

## set up loop and test all numbers...

So in order for Maple to return possible solutions I would need to set up a loop to try numbers and then return ones that are true.

## Yes that is what I got, problem is can't...

Sure

with(Student[Calculus1]):

c:=Roots(x^2-10-sin(x)-cos(x),x=-10..10,numeric);

But now I have to substitute those values into a to find the y intercept for each x (ie. subs(c[1],a); etc...) for all the intercepts.  I really don't want to have to do that.

What I'd like to do is have Maple calculate the x,y intercepts in one step and show them to me.  This is what I've tried and I can't seem to prod it out of Maple.

a:=y=x^2-10-10*sin(x);

b:=y=cos(x);

solve({a,b});  or solve({a,b},{x,y});

Returns x=RootOf ... and y=RootOf answers.  I try to evalf(%) or allvalues(%)  but I only get one answer

{x=-1.006881416,y=0.5344990470}

fsolve({a,b}); or fsolve({a,b},{s,y})   gives me another of the intercepts, but doesn't tell me all of them {x=-1.144307303,y=0.4136768823}

fsolve doens't seem to like multiple equations specified over a range so I can't find all the intercepts using fsolve without having to first combine the equations and finding the roots and then use the subs command.

So how can I get maple to produce the 4 points of intersection {x=..., y= ...} , {x= ... , y= ...} , {x= .. , y= ... } , {x= .. , y= ... } ?

## Intersection of y=x^2-10-10*sin(x) and y...

This is sort of along the same line of problem.

a:= y=x^2-10-10*sin(x);

b:=y=2;

solve({a,b},{x,y});

Again only returns one solution, x as a RootOf and y=2 answer.  Using allvalues(%) returns the same answer.  Can't get the other 3 points of intersection with a single command.

## Student[Calculus1]...

Thanks for all the options.  It seems like using Student[Calculus1] Roots seems to be the best option.

Using fsolve with avoid will still miss some roots if there are more than one root within the range.

In my opinion I think fsolve should return all roots within a specified range.  Even if I use solve, I get a RootOf answer that I can't seem to coax out the real numbers for the roots.

solve(x^2/20-10*x-15*cox(15+x));

-15 + RootOf( -300 cos(_Z) + 3225 - 230 _Z + Z^2)

 First 39 40 41 42 43 Page 41 of 43
﻿