## Jean-Paul CIPRIA

————— PHYSICS – SPACE – ALGORITHMICS ——-

## Algorithmics 04 – Prime Numbers – Erathostene Algorithm

Written By: Jean-Paul Cipria - Mai• 25•17

Compiled Matlab Calculations – ©J.P. Cipria

How do Calculate the first Prime Numbers when we use Erathostene Methods ?

# Why use Prime Numbers when you are Physicist or an Engineer ?

## Then let’s try to do a multiplication ?

How you do it pratically ? You use « Classic Method » when you write first operand then you multiply with second operand less digit … then you do the same with second operand second digit with a base 10 shift. After all … you add all this operation N times. Then you did $N^2$ operations.

But we are physicists then we do $N=1000000$ multiplications for a single 3D radar signal. Then we performed $N^2=1 000 000 000 000$ single operations !!! That’s is boring for time, money, memory and computer availibility and Engineer skills !

## How do a simple Multiplication ?

When you UNDERSTAND what a multiplication is … then you can DISCOVER other methods to do it.

First Erathostene discovered, V centuries before Jesus Christ, that we can divide some numbers by another particular ones. Now in engineering or physicist understanding we said « We project a number on a perpendicular base. This base is constructed with premium numbers. » Why ?

let’s try for $x$ integer if $x=p_1*p_2*\dot\dot\dot*p_n$ ? Then like a vectorial decomposition $x=x_1*\vec{e_1}+\dot\dot\dot+x_n*\vec{e_n}$ we project x on a $n$ base of perpendicular vectors. We do the same method for addition and multiplication. The question is :

« How to project a number on a selected base of vectors ? For the addition ? OK ! For the multiplication ?«

Somebody had explained you this kind of thought ? No ? Shame ? Do you live in France ? Shame ?

## First 78499 Premium Numbers by Erathostene Method ?

• Nombre Essais=1000000 – Nombre Total=78 499 – Durée=221.625387 – 3,7 min – Last one = 999 983
• Nombre Essais=4000000 – Nombre Total=283 147 – Durée=3126.248683s – 52 min – Last one = 3 999 971
• Nombre Essais=10000000 – Nombre Total=664 580 – Durée=16188s – 4h30 – Last one = 9 999 973 and 9 999 991

There are 78499 premium numbers when you search them from N=1 to 1 000 000 tries in 3,68 min over Matlab not so rapid but demonstrative.

First 10 millions tries in Text file – 664 580 Primes :

List of the first 1 Millions tries : 78 499 Primes :

1 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 101 103 107 109 113 127 131 137 139 149 151 157 163 167 173 179 181 191 193 197 199 211 223 227 229 233 239 241 251 257 263 269 271 277 281 283 293 307 311 313 317 331 337 347 349 353 359 367 373 379 383 389 397 401 409 419 421 431 433 439 443 449 457 461 463 467 479 487 491 499 503 509 521 523 541 547 557 563 569 571 577 587 593 599 601 607 613 617 619 631 641 643 647 653 659 661 673 677 683 691 701 709 719 727 733 739 743 751 757 761 769 773 787 797 809 811 821 823 827 829 839 853 857 859 863 877 881 883 887 907 911 919 929 937 941 947 953 967 971 977 983 991 997 1009

.
Jean-Paul Cipria
25/05/2017

You can follow any responses to this entry through the RSS 2.0 feed. You can skip to the end and leave a response. Pinging is currently not allowed.