[AI] formula for prime numbers
Zujar Shabbir Kanchwala
zujarbright at gmail.com
Thu Sep 2 02:57:33 EDT 2010
Divisibility test for 9:
If the one-digit sum total of the digits of a number is 9 then the the
number is divisible by 9. For example,
Let's take the number 2471913
Total of digits = 2 + 4 + 7 + 1 + 9 + 1 + 3 =27
once more, total of digits = 2 + 7 = 9
Hence, the number 2471913 is divisible by 9.
NB: This divisibility test is similar to the one for 3 except that the
result for divisibility by 3 should be 3, 6 or 9.
An optimist laughs to forget, whereas a pessimist forgets to laugh!
On 9/2/10, Amiyo Biswas <amiyo.biswas at gmail.com> wrote:
> There are some similar tricks for determining if a number is a prime one. If
> you add the last two digits and the previous ones and the result is
> divisible by 11, the number is divisible by 11. In this case of Kartik's
> example, 21 +23 = 44 which is divisible by 11. I have forgotten some tricks
> which can determine dibisibility by 7.
> In C / C++ lessons, you may be asked to write a utility for finding out a
> prime number.
> With best regards,
> Amiyo Biswas.
> Cell: 9433464329
> ----- Original Message -----
> From: "Kartik Sawhney" <sawhney.kartik at gmail.com>
> To: <accessindia at accessindia.org.in>
> Sent: Thursday, September 02, 2010 11:01 AM
> Subject: Re: [AI] formula for prime numbers
>> In order to compute and determine if a large number is
>> prime/composite, adopt the following method:
>> For example sake I'll use the number 2,321
>> 1) Find the square root of the number - The Square root of 2,321 is
>> 2) remember that if the square root results in an integer it is
>> automatically composite
>> 3) if your number ends in a 0,2,4,5,6,8 it is NOT PRIME
>> - 2,321 ends in a 1, so we keep going
>> 4) add up the digits of your number, if the sum is divisible by 3,
>> your number is composite (basically testing the divisibility of the
>> number by 3)-2+3+2+1= 8 3 does not go into 8 evenly- onto the next
>> 5) Divide the number by all the prime numbers less than the square
>> root (you can skip 2, 3, and 5)
>> -since the square root of 2,321 is 48.176..., we need to
>> try dividing 2,321 by primes less than 48
>> (7,11,13,17,19,23,29,31,37,41,43,47) since 2,321 is
>> divisible by 11, it is NOT prime and therefore composite.
>> 6) If a number is not divisible by any of the prime numbers less than
>> the square, it is PRIME, if it is, it's COMPOSITE.
>> I hope this will help you.
>> Voice your thoughts in the blog to discuss the Rights of persons with
>> disability bill at:
>> To unsubscribe send a message to accessindia-request at accessindia.org.in
>> with the subject unsubscribe.
>> To change your subscription to digest mode or make any other changes,
>> please visit the list home page at
> Voice your thoughts in the blog to discuss the Rights of persons with
> disability bill at:
> To unsubscribe send a message to accessindia-request at accessindia.org.in with
> the subject unsubscribe.
> To change your subscription to digest mode or make any other changes, please
> visit the list home page at
More information about the AccessIndia