Christopher2222

MaplePrimes Activity


These are questions asked by Christopher2222

being stalled myself here why don't these work?

for i from 1 to 200 do
  if ithprime(i)=prevprime(500) then print i; end if;
end do;

and

solve(ithprime(i)=prevprime(500),i)

??

What would be a better way?  I could do

for i from 1 to 200 while ithprime(i)<500 do end do; i;
                       ...

In a previous question I answered I had attempted to turn what I did into a proc.  It works fine by itself but when it's in a proc it won't display both plots.  Not sure if it's because there's too many levels of calling or if it's a bug. 

plotoversurface:=proc(p1,s1)
  local a,b,to3d,c:
  a:=plot3d([s1],x=-10..10,y=0..100,style=patchnogrid):
  b:=plot(p1):
  to3d:=plottools:-transform((x,y)->[x,y,s1]):
  c:=to3d(b):

Maples own spiralgraph or kalidascope.

It's kind of annoying sometimes when you create a plot and you haven't got enough points to see a nice smooth curve.  It's an easy fix, of course. Just add numpoints=x where x is any number you want.

However, that being neglected this simple little animation reminded me of the spiralgraph craze in the early 80's, or could even be a kalidascope if the colors changed.

with(plots):
animate(spacecurve,[[sin(x*t),x,cos(x*t)...

How can I call a procedure value from inside a string?

I'm trying to put a counter in this specific type of ( for .. in ) loop.  Can't figure it out.

a:=[5,6,7]:
b:=[4,3,9]:

#unfinished code
counter1:=1:
counter2:=1:
for i in a do
  for j in b do
    c[counter1,counter2]:=i+j:
  end do:
end do:

What I can't figure out is, how to get it to work as easily as in this type of for loop. 

for i from 1 to nops(a) do
  for j from 1 to nops(b) do

First 72 73 74 75 76 77 78 Last Page 74 of 99