recently there was a question to make program by solving the sequence-pattern given in input and output... please try to find it ,and help me if you can .... for every two integer input ,an output was given:

input

(1 4)

(2 3)

(4 10)

(7 10)

(8 100)

(200 300 )

(255 275)

output 5 5 12 7 1043 4048 1060

respectively how can input and output be related here, to each other????

edit : i would like to thank ChasmOfSarcasm for his message ,thanks for solving it .

Ain't nobody got time for that.

but you definitely got time to comment ... LOL .

I could not come up with a solution after looking at it , I am trying to think now but am tired.But, how do we know you are not just typing a random list of numbers and trolling us?

Please provide link to the problem.

https://www.hackerearth.com/codearena/ring/14d2717/

this is link of that problem ...

Here's simple program which solves given task:

So what did you sacrifice to become master?

5 stacks of yellow dye in Minecraft.

this code is not working ?? i think i was unable to interpret problem correctly .. here is its link

https://www.hackerearth.com/codearena/ring/14d2717/

bro ,your solution is wrong , i got the correct answer from ChasmOfSarcasm ... here output is the sum of prime numbers between input range [a b] ... thanks for trying it and giving your time for my question ...

Did you even like, read the code?

yes , he is using random values and taking its mod with 5000 ..., i too initially thought to do this as i was unable to build any connection between input and output . but it failed ....

can you please tell us how we can also learn to make such observation? I could not see it

You have to be more specific on what type of relationship you're looking for. Any set of input and output values can be fitted perfectly by some polynomial. For example, I could say that the output is

`(197121089224141 x^5)/14824459483725929637600 - (9060603386308189 x^4)/570171518604843447600 + (26660326915496837687 x^3)/4941486494575309879200 - (1422560370026178478451 x^2)/3706114870931482409400 + (4867386451591739811563 x)/741222974186296481880 - 3706498869439340167/196090733911718646`

where`x`

is the sum of the two inputs.How did you find this polynomial?

It's evident BessieTheCow has spent a lot of time on AOPS.

Wolfram Alpha: https://www.wolframalpha.com/input/?i=interpolating+polynomial+(5,+5),+(14,+12),+(17,+7),+(108,+1043),+(500,+4048),+(530,+1060)

your link is not working

The markup parser seems to have trouble with parenthesis in links.

so ,you mean ,you are trying to fit all given sample test in a polynomial equation , but then it will fail at system test .... if we do it without any logic ...

That isn't supposed to be a solution to the problem. The point is that "find a relationship between a given set of inputs and outputs" isn't really a good question because there will always be many possible relationships that match any set of input and outputs if we don't restrict the type of relationship we're looking for.

I got you bro , but here i got solution ( credit : ChasmOfSarcasm)..... output is sum of prime numbers between given input range [a b] ....

we need to observe the repeated pattern ,after your response i tried to make graph between input a ,input b and output in 3-d but it was very hard to observe any pattern except if we don't know prime numbers are involve there . also it will form a non continuous discrete points plot.. there also main task will be to observe & interpret the pattern between a and b which result output in z axis.. it is very tough to know it ,without knowing value of function between a and b at various point.

i observed your link , now i got to know ,what you were saying ... thanks for it ,your logic is definitely correct. there are multiple answer to it .

This is the link of that problem https://www.hackerearth.com/codearena/ring/14d2717/

i think i was unable to interpret problem correctly ,please have a look at it