d2jsp
Log InRegister
d2jsp Forums > Off-Topic > General Chat > Homework Help > Sum Of Consecutive Integers
12Next
Add Reply New Topic New Poll
Member
Posts: 38,211
Joined: Feb 16 2009
Gold: 7,823.69
Jan 11 2015 07:22pm
i am trying to find how many different ways a positive integer can be expressed as the sum of consecutive whole numbers

is there any tricks to doing this or am I stuck wth prime factorization?
Member
Posts: 32,925
Joined: Jul 23 2006
Gold: 3,804.50
Jan 11 2015 07:27pm
http://2000clicks.com/mathhelp/PuzzleSumsOfConsecutiveIntegersAnswer.aspx

maybe this will help?

This post was edited by carteblanche on Jan 11 2015 07:27pm
Member
Posts: 9,099
Joined: Nov 23 2002
Gold: 2,911.26
Jan 11 2015 08:25pm
You could write a program to do it for you
hitCounter=1
testNum=x
for i=1:x-1
counter=0
sumFVal=0
while count<=x
if count==x
hits(hitCounter,:)=[; sumFVal]
hitCounter=hitCounter+1
end
count=count+i
end
end
Member
Posts: 38,211
Joined: Feb 16 2009
Gold: 7,823.69
Jan 11 2015 09:26pm
Quote (TheStealthTarget @ Jan 11 2015 06:25pm)
You could write a program to do it for you
hitCounter=1
testNum=x
for i=1:x-1
counter=0
sumFVal=0
while count<=x
if count==x
hits(hitCounter,:)=[; sumFVal]
hitCounter=hitCounter+1
end
count=count+i
end
end


number theory though

trying to do it with math
Member
Posts: 167
Joined: Oct 2 2014
Gold: 0.00
Jan 12 2015 11:26am
Id say ull prob have to do pryime factorisation
Member
Posts: 9,099
Joined: Nov 23 2002
Gold: 2,911.26
Jan 12 2015 12:57pm
You can solve the following equation

#=x+(x+1)
#=x+(x+1)+(x+2)
#=x+(x+1)+(x+2)+(x+3)
and so on... this also breaks down from the pattern to

#=(n+1)x+n(n+1)/2

where n is the number of terms in the addition besides the starting term and x is the starting number. # is the number you are trying to find. you can rearrange this too

#=(n+1)(x+n/2)

how do solve this, i don't know
Member
Posts: 38,211
Joined: Feb 16 2009
Gold: 7,823.69
Jan 12 2015 05:06pm
right meow all I have is prime factorization --> odd factors
Member
Posts: 14,433
Joined: Oct 14 2013
Gold: Locked
Trader: Scammer
Jan 12 2015 05:14pm
isnt this just the Fibonnaci sequence
Member
Posts: 38,211
Joined: Feb 16 2009
Gold: 7,823.69
Jan 12 2015 05:55pm
Quote (JDota72 @ Jan 12 2015 03:14pm)
isnt this just the Fibonnaci sequence


not entirely

consider 100

we want every set of consecutive whole numbers that add to 100

it has 1 | 2 | 4 | 5 | 10 | 20 | 25 | 50 | 100 (9 divisors) of which its prime factorization is 2^2 5^2

looking at the divisor 5 we have one set of consecutive whole numbers that add to 100 in which the average is 20 or 18+19+20+21+22

fibonnaci only added the previous two numbers to get the next --unless there is some generalized formula I am not aware of-- im looking for some kind of formula that I can just put some number in and it will tell me how many different sets of consecutive integers I can have to equal that number

if there isn't im stuck with prime factorization and odd factors
Member
Posts: 167
Joined: Oct 2 2014
Gold: 0.00
Jan 12 2015 06:14pm
u dont need prime factorisation as long as you have the factors
Go Back To Homework Help Topic List
12Next
Add Reply New Topic New Poll