All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Just Math
Sum Divisibility Dilemma (Posted on 2014-03-18) Difficulty: 3 of 5
Determine a general formula (in terms of n) for the sum of the first n positive integers that are not divisible by 5.

No Solution Yet Submitted by K Sengupta    
No Rating

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution Different formula, same result | Comment 2 of 6 |
Well, let s be the number of numbers that need to be skipped to get n that are not multiples of 5.  Then we sum up the first n+s numbers, and subtract out the first s multiples of 5.

This equals (n+s)(n+s+1)/2 - 5s(s+1)/2 

And s = floor(n/4)

So, for example, if n = 13, then s = 3
sum = 16*17/2 - 5*3*4/2 = 136 - 30 = 106

This is the right answer, as (1+2+3+4)+(6+7+8+9)+(11+12+13+14)+16 = 10+30+50+16 = 106

The previous post, if I followed it correctly, has q = 3 and r = 0,
for a total of 13*14/2 + 3*(6 - 1) = 91 + 15 = 106,
so the two formulae yield the same result, at least in this case

  Posted by Steve Herman on 2014-03-18 13:18:11
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (0)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information