mantas84

30 Reputation

5 Badges

12 years, 50 days

MaplePrimes Activity


These are questions asked by mantas84

I am trying to plot sequence like:

arrayZ[1]:=NULL;
arrayZ[2]:=5;
arrayZ[3]:=NULL;
arrayZ[4]:=NULL;
arrayZ[5]:=8;

...

arrayZ[3000]:=1111;
data:=[seq([n,arrayZ[n]], n=1..3000)]:
t1:=plot(data, style=point, symbol = solidcircle, color= red):
plots[display]({t1});

but get incorrect first argument error. How to fix this?

PS. In original sequence instead of null I have constant value, but I don't want it in my plot.


I am trying to understand how maple "isprime" algorithm works. But I can't find anywhere what special_primes means.

 

 showstat(isprime);

isprime := proc(n)
local btor, nr, p, r;
   1   if not type(n,'integer') then
   2     if type(n,('complex')('numeric')) then
   3       error "argument must be an integer"
         else
   4       return 'isprime(n)'
         end if
       end if;
   5   if n < 2 then
   6     return false
       elif member(n,isprime:-special_primes) then
   7     return true
       elif igcd(2305567963945518424753102147331756070,n) <> 1 then
   8     return false
       elif n < 10201 then
   9     return true
       elif igcd(8496969489233418110532339909187349965926062586648932736611545426342203893270769390909069477309509137509786917118668028861499333825097682386722983737962963066757674131126736578936440788157186969893730633113066478620448624949257324022627395437363639038752608166758661255956834630697220447512298848222228550062683786342519960225996301315945644470064720696621750477244528915927867113,n) <> 1 then
  10     return false
       elif n < 1018081 then
  11     return true
       else
  12     r := gmp_isprime(n);
  13     if not r or n <= 5000000000 then
  14       return r
         end if;
  15     nr := igcd(408410100000,n-1);
  16     nr := igcd(nr^5,n-1);
  17     r := iquo(n-1,nr);
  18     btor := modp(('power')(2,r),n);
  19     if cyclotest(n,btor,2,r) = false or irem(nr,3) = 0 and cyclotest(n,btor,3,r) = false or irem(nr,5) = 0 and cyclotest(n,btor,5,r) = false or irem(nr,7) = 0 and cyclotest(n,btor,7,r) = false then
  20       return false
         end if;
  21     if isqrt(n)^2 = n then
  22       return false
         end if;
  23     for p from 3 while numtheory:-jacobi(p^2-4,n) <> -1 do
  24       NULL
         end do;
  25     return evalb(TraceModQF(p,n+1,n) = [2, p])
       end if
end proc

c1 := circle([0, 0], 1, color = red);
p2 := implicitplot(x = 1/2, x = -2 .. 2, y = -1 .. 1.1, colour = blue, linestyle = 1, thickness = 2);
display(c1, p2);

How to fill that part beetween line and circle(where x>1/2 in circle )?

Hi,

I tried to export my maple document to latex using file->export function, but it won't export file correctly. For example

in maple
> a := 5431; b := 15971; c := 20551;
> f := -a-b-c;
                             -41953

in latex

\documentclass{article}
\usepackage{maplestd2e}
\def\emptyline{\vspace{12pt}}

Hi,

statements

1 2 Page 1 of 2