DS / numper properties

This topic has expert replies
Master | Next Rank: 500 Posts
Posts: 109
Joined: Mon Sep 08, 2008 12:47 am

DS / numper properties

by smallsorrow » Mon Nov 03, 2008 2:45 am
If n is a positive integer and r is the remainder when n^2-1 is divided by 8, what is the value of r?

1) n is odd

2) n is not div by 8

my reasoning:

(n^2-1) / 8 = k+r
n^2-1= 8 (k+r)
n^2-1= 8k + 8r

now plug in for n odd values and for k 1,2,3,4, etc. - we´ll see that r=0

hence 1 is sufficient...
I am not sure if I am right, can anyone confirm... ?

Thanks

Legendary Member
Posts: 1035
Joined: Wed Aug 27, 2008 10:56 pm
Thanked: 104 times
Followed by:1 members

by scoobydooby » Mon Nov 03, 2008 3:04 am
you are right about r= 0, but n^2-1 =8k+r, so when you put odd values for n, r=0 as 8k would divide n^2-1

n^2-1=(n+1)(n-1). if n=odd, both n+1 and n-1 are even, they are consecutive even numbers. product of 2 consecutive even numbers are always divisible by 8, so remainder be always be 0