prime number tricks

This topic has expert replies
Newbie | Next Rank: 10 Posts
Posts: 9
Joined: Fri Jan 05, 2007 4:20 am

prime number tricks

by slimsohn » Thu Mar 01, 2007 3:16 pm
Hi all,

I was wondering if there are any special tricks or formulas involving problems with prime numbers and/or if a number is/should be divisible by a prime. (ex: when they have some HUGE number and you have to see if its divisible by a prime or if they want the largest prime factor.)



thanks

User avatar
Legendary Member
Posts: 986
Joined: Wed Dec 20, 2006 11:07 am
Location: India
Thanked: 51 times
Followed by:1 members

Re: prime number tricks

by gabriel » Fri Mar 02, 2007 8:05 am
slimsohn wrote:Hi all,

I was wondering if there are any special tricks or formulas involving problems with prime numbers and/or if a number is/should be divisible by a prime. (ex: when they have some HUGE number and you have to see if its divisible by a prime or if they want the largest prime factor.)



thanks
well if to check if a number is divisible by a prime u will have to do it the old fashioned way... dividing it by the prime number..... but about the largest prime factor thing ... i do remember reading something about it in my old "hall & knight " .... will dig out the book and get back to u if i find something useful...

User avatar
Junior | Next Rank: 30 Posts
Posts: 26
Joined: Wed Oct 11, 2006 11:02 pm
Location: Tuck School of Business, U of Dartmouth
Thanked: 4 times
Followed by:8 members
GMAT Score:770

Prime Number tricks

by mukul » Fri Mar 02, 2007 10:26 am
To check there isnt any method...or may be i dont know....but what I know is pretty useful.

Here it goes... to find the number is prime or not you can use this...
lets say the no. is x. find out the nearest perfect square lower than the number. and get its square root. check for all the prime numbers less than that (the square root).

example:

lets take 109...is it a prime number or whats the greatest prime factor?
nearest perfect square is 100. 10^2

so now check for 2, 3, 5, 7..thats it..after that 11 is greater than 10.

109 is divisible by 2? no
3? no
5? no
7? no

so it is a prime...109

i hope this simplifies to a great extent.

lets take 119

nearest square...100 again
10
so take 2, 3, 5, 7
its divisible by 7
so 7 is the greatest prime factor.

I think this is the shortest method.

Hope that helps!
:)