#11
|
|||
|
|||
Re: For all you math puzzle nuts...
Damn, I hate you Bruce. [img]/images/graemlins/smile.gif[/img]
I was getting close, but couldn't figure out how to turn the odd n terms to even without changing the even n terms. Basically, this part is where I was stuck -> [1 - (-1)^n]/2 -- Homer |
#12
|
|||
|
|||
Re: For all you math puzzle nuts...
why isnt it like:
N: 1 2 3 4 5 6 7 8 9 ...0 1 1 2 2 3 3 4 4 ??? |
#13
|
|||
|
|||
Re: For all you math puzzle nuts...
[ QUOTE ]
why isnt it like: N: 1 2 3 4 5 6 7 8 9 ...0 1 1 2 2 3 3 4 4 ??? [/ QUOTE ] The book doesn't specify, but I'm pretty sure it's supposed to be like that. My answer is in white below: <font color="white"> n/2 - [1 - (-1)^n ]/4 n >= 1 </font> |
#14
|
|||
|
|||
Re: For all you math puzzle nuts...
[ QUOTE ]
[ QUOTE ] why isnt it like: N: 1 2 3 4 5 6 7 8 9 ...0 1 1 2 2 3 3 4 4 ??? [/ QUOTE ] The book doesn't specify, but I'm pretty sure it's supposed to be like that. My answer is in white below: <font color="white"> n/2 - [1 - (-1)^n ]/4 n >= 1 </font> [/ QUOTE ] That's the same as my second solution if you break mine into two terms. It's arbitrary whether you start counting from 0 or 1. Math people usually start from 1, while computer science people index arrays from 0. |
#15
|
|||
|
|||
Re: For all you math puzzle nuts...
grunching.
-1^n : 1 -1 1 -1 1 -1 2n 0 2 4 6 8 10 + 1 1 5 5 9 9 so, (2n+(-1^n)-1)/4 produces 0 1 1 2 2 ... etc for n=1..infinity |
#16
|
|||
|
|||
Re: For all you math puzzle nuts...
[ QUOTE ]
I came across this problem while doing my Calc hw today. Took me awhile to get it, I thought it was a pretty neat problem. Find a formula for the nth term of this sequence. 0, 1, 1, 2, 2, 3, 3, 4, ... (each positive integer repeated). The whole time I was doing this I was thinking about how much easier it would be to just write a C code for it, damn calculus and it's lack of ability to round down to the nearest factor of 2. Enjoy. Edit - fixed sequence typo, and edited to add no using mod or anything such as that. Only standard math terms, ie. + , - , x , divide, and powers. Edited again to say that you can only use one function that will apply to your whole sequence, no dividing odds and evens between two seperate functions. [/ QUOTE ] What math is this? |
|
|