[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Primtal for politikere



Her er i koncentreret udgave eksemplet, som blev udarbejdet på
SSLUG-mødet.

Er der een, der kan lave det om til MatHTML, så det er nemt at vise
politikerne?

/Ole


Ren matematik:
n er primtal <=> \forall x \in {2 .. n-1}: x \gårikkeopi n


Mellemting 1:
primtal(n) = prim(n,n-1)
            /  x \gårikkeopi n  \and  prim(n,x-1)   x>2
prim(n,x) = |
            \  x \gårikkeopi n                      x=2


Mellemting 2:
primtal(n) = prim(n,n-1)
            /  (x mod n) and prim(n,x-1)   x>2
prim(n,x) = |
            \  x mod n                     x=2

Program:
sub primtal(n) { return prim(n,n-1) }
sub prim(n,x) {
  if(x>2) { return (x mod n) and prim(n,x-1) }
  else    { return x mod n }
}


-- 
Prisen falder hvert minut. Hvor længe tør du vente?
                                         www.bud.dk



 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 20:11 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *