Sunday, February 8, 2009

Prime post alert!

Well, this is post 157 - another prime posting!  Prime numbered that is.  Not that it's terribly exciting for most people, but it's pretty fun.  A little tip - you only have to check the primes less than or equal to the square root of the number being checked.  So for 157, the square root is +/-12.52... (I'm not writing out all those values).  Or, for all those without a calculator handy, 10^2 == 100, 11^2 == 121, 12^2 == 144, 13^2 == 169 so between 12^2 and 13^2.  Discrete math is fun!  So, let's review the prime numbers, excluding 1: 
  • 2: 157 is not even, so not a divisor
  • 3: 157/3 == 52, remainder 1 so no good.  
  • 5: 157 doesn't end in 0 or 5, so not a divisor
  • 7: 157/7 == 22, remainder 3
  • 11: 157/11 == 14, remainder 3
So, there you have it - 157 is prime.  Next time, I may have to run through the proof of why we only have to look at the primes <= square root of the value - although "simple symmetry" is a good hand-wavy version of the proof.

Today wasn't all prime numbers and other values - the real interesting bits were in the people interactions.  One was my parents, back from vacation.  My dad's comment, and I'm sure I'm going to hear it again after every trip, is his shock at the size of the other people he saw there.  Not the locals, but other vacationers.  I guess the people that can best afford such a vacation show their wealth in many ways - how well fed they are being one of them.  I know there have been stories and documentaries that show how developed countries have increasing incidents of obesity and this is how I'd expect it to demonstrate itself.  Also, they got me a t-shirt as a souvenir and it is size "L", but I think I could camp under it.  I mean, it is really wide - like "Large Tent", not "Large shirt".  And I am not slim.  I have never, ever, been accused of being slim, so this is puzzling and scary.  Maybe I can look forward to fitting into "small" because they'll base it on height not girth.  Whatever - they had a good time.

The other human interaction thing is my oldest son.  He had some kind of day today - couldn't seem to get requests to change his behaviour through.  It was immensely frustrating and I tried to deal with it in a calm fashion, but sometimes it is very difficult.  I think I'll have to try a completely new approach, which is to remove him from stimulus until he understands why my wife and I aren't happy.  He'd get louder and louder (as he got more into whatever he was doing) and it would become unbearable.  I kept trying to point out what was happening, but that wasn't enough.  Just being told that he was escalating was not registering with him.  I also think it would be good to have a time where I could shove him out the door and say "be as loud as you want out there, just don't come back in for an hour."  That ain't gonna happen 'cause he needs more assistance to figure out what to do outside.  Plus there's that whole parental-paranoia that can't let well enough alone, er, let kids out without exact coordinates.  Ah well - I'll figure out.  Probably when he's off to university, but hopefully I'll still take comfort in the pure knowledge, rather than be sad that the time for the knowledge has past.

2 comments:

Anonymous said...

No need to exclude 1 -- it's not prime! :-)

cjguerra said...

Whoops - serves me right for not checking again. The best definition is that primes are greater than 1. I just couldn't remember for certain, because I believe there are solid definitions with 1 as prime - it doesn't break anything. It's just convenient to leave it out. Check out this reference for some good definitions.