Official Everybody Edits Forums

Do you think I could just leave this part blank and it'd be okay? We're just going to replace the whole thing with a header image anyway, right?

You are not logged in.

#1 Before February 2015

Kaslai
Official Caroler
From: SEAͩT̓͑TLͯͥͧͪ̽ͧE͑̚
Joined: 2015-02-17
Posts: 787

Programming/Math challenge of the week

(This is now a parallel thread; its sister can be found here)

I think that this forum needs one of these topics. Each week I'll try to post a fast but interesting problem that can be solved with a little programming logic.

Things to note:
-Answers will be posted as spoilers (Aw you spoiled it!) when the following question is posted.
-Please send answers in PM or E-Mail; do not post them on the thread.
-Questions will not be posted at any specific date, but there will never be a time gap smaller than 6 days between questions
-Questions are technically solvable by hand, but it could take hours or even days to do so.
-I encourage you to share the method used to find the solution, be it code, scans of paper, or whatever else.
-The first person to solve a question gets a rep change in their chosen direction, as well as a mention in the hall of fame

Week 1 (Feb 16, 2012): Algorithm programming
Week 2 (Feb 22, 2012): Calculus

Hall of fame (EE)
Bass5098 - 1
Musuki - 1

Hall of fame (Cemetech)

Last edited by Aslai (Feb 22 2012 7:11:48 pm)

Offline

#2 Before February 2015

Jeremifier
Guest

Re: Programming/Math challenge of the week

n[x] =   (x + a[1]) * (x + a[2]) * ? * (x + a[k]) / d

That hurt my brain.^

Last edited by Jeremifier (Feb 17 2012 4:16:38 am)

#3 Before February 2015

theditor
Member
Joined: 2015-02-18
Posts: 1,320

Re: Programming/Math challenge of the week

****.
All i can say.

Offline

#4 Before February 2015

Kaslai
Official Caroler
From: SEAͩT̓͑TLͯͥͧͪ̽ͧE͑̚
Joined: 2015-02-17
Posts: 787

Re: Programming/Math challenge of the week

Week 1: Algorithm programming

You are given an integer k>0 and a series of k+2 numbers n[1], n[2], ?, n[k+2]. You are told that the numbers in the series are calculated using an equation of the following form for n>0:

n[x] =   (x + a[1]) * (x + a[2]) * ? * (x + a[k]) / d

You do not know the value of d. You do not know the values for a[1] ... a[k]. You only know that each (a ? 0) and (d > 0) and you can assume that the product in the numerator is evenly divisible by the integer value d. You can assume that the numerator can be represented by a 32-bit integer. But you know that the formula for n[x] is a polynomial function of degree k and you know the value of k+2 points for this function. Based on this information, you actually have enough information to calculate the next number n[k+3] in the sequence! This is your task.

Input Format

Your program will read from standard input. The first line will contain a single positive integer by itself that represents the value k. The second line will consist of (k+2) integer values separated from each other by a single space. The values on the second line represent the series n[1] through n[k+2].
Output Format

Your program must write to standard output a single integer on a line by itself representing the value for n[k+3].
Sample Input and Corresponding Sample Output

----

Input wrote:

1
3 4 5

Output wrote:

6

----

Input wrote:

2
1 3 6 10

Output wrote:

15

----

Input wrote:

4
170 405 798 1400 2268 3465

Output wrote:

5060

----

Input wrote:

5
1764 4160 8400 15300 25872 41344 63180

Output wrote:

93100

----

Input wrote:

4
1 16 81 256 625 1296

Output wrote:

2401

----
I had fun solving the problem. Who else can solve it?

The first person to give the correct answer for this input wins.

6
3969 15360 44550 108000 231231 451584 821340 1411200

People who solved it before the answer was posted (EE):
- Bass5098 - Method
- musuki - Method
-
-
-
People who solved it before the answer was posted (Cemetech):
-
-
-
-
-
Answer: 2314125

[i]Last edited by Aslai (Feb 21 2012 6:44:54 pm)

Offline

#5 Before February 2015

Jojatekok
Guest

Re: Programming/Math challenge of the week

Well made thread, but you misspelled 'Year 1' as 'Week 1'...

#6 Before February 2015

Kaslai
Official Caroler
From: SEAͩT̓͑TLͯͥͧͪ̽ͧE͑̚
Joined: 2015-02-17
Posts: 787

Re: Programming/Math challenge of the week

Har har =p

I restructured the thread a bit, as to limit first post spam

Offline

#7 Before February 2015

Tako
Member
From: Memphis, Tennessee, USA
Joined: 2015-08-10
Posts: 6,663
Website

Re: Programming/Math challenge of the week

Aha, I get it now. I'll start working on it.

Wait wat is d.


Yeah, well, you know that's just like, uh, your opinion, man.

Offline

#8 Before February 2015

Kaslai
Official Caroler
From: SEAͩT̓͑TLͯͥͧͪ̽ͧE͑̚
Joined: 2015-02-17
Posts: 787

Re: Programming/Math challenge of the week

Question one is now closed! Here's question two.

Week 2 (Feb 22, 2012): Calculus

You have an object drawn in procedural CAD software, and the volumetrics are malfunctioning! Find the volume of this complex 3D shape.
You begin with this sketch
hl8y
And you rotate it about the axis at X = -0.5
hl9s
On the flat face, you make this sketch
hlc6
And on the plane perpindicular to the open section of the revolve, you make a 1 by 1/2 rectangle in the middle of the two points, 2 inches away from the midpoint of the contacting lines.
hlhJ
Extrude that rectangle by 3 inches
On the face of the rectangular prism you just made that faces the other shape, draw a .75 by .2 rectangle on it such that the center of it matches the center of the circle sketch on the old shape
hllP
Perform a linear loft between the rectangle and circle
hlmr
What is the volume of this shape? Give the exact answer, not a decimal equivalent.
hlna
People who solved it before the answer was posted (EE):
- Musuki
-
-
-
-
People who solved it before the answer was posted (Cemetech):
-
-
-
-
-
Answer: Wait a few days!

Last edited by Aslai (Feb 22 2012 7:11:23 pm)

Offline

#9 Before February 2015

Master1
Member
From: Crait
Joined: 2015-02-15
Posts: 4,452

Re: Programming/Math challenge of the week

pshh that ones easy, the answer is obviously, 42.


nicktoot.pngnicktoot.pngnicktoot.png

Offline

#10 Before February 2015

Jojatekok
Guest

Re: Programming/Math challenge of the week

Master1 wrote:

pshh that ones easy, the answer is obviously, 42.

Yeah, we all know that's the answer of the life... But Aslai's questions aren't acceptable for the life.

#11 Before February 2015

Master1
Member
From: Crait
Joined: 2015-02-15
Posts: 4,452

Re: Programming/Math challenge of the week

42 is the answer to life, universe, and everything. I believe I am correct //forums.everybodyedits.com/img/smilies/smile


nicktoot.pngnicktoot.pngnicktoot.png

Offline

#12 Before February 2015

Kaslai
Official Caroler
From: SEAͩT̓͑TLͯͥͧͪ̽ͧE͑̚
Joined: 2015-02-17
Posts: 787

Re: Programming/Math challenge of the week

I'm tempted to -rep you, Master1.

Offline

#13 Before February 2015

Master1
Member
From: Crait
Joined: 2015-02-15
Posts: 4,452

Re: Programming/Math challenge of the week

Come at me bro //forums.everybodyedits.com/img/smilies/big_smile


nicktoot.pngnicktoot.pngnicktoot.png

Offline

#14 Before February 2015

Jaybm
Guest

Re: Programming/Math challenge of the week

Funny, I just learned about this in math today. I still have no idea what the answer is. *tries to solve*.

Kaslai1423655789305643

Board footer

Powered by FluxBB

[ Started around 1732697917.897 - Generated in 0.219 seconds, 12 queries executed - Memory usage: 1.51 MiB (Peak: 1.67 MiB) ]