Image copyright Pearson Image caption A question about Hannah's sweets angered some GCSE students

A tricky GCSE maths question stumped thousands of students - but inspired them to take to Twitter to vent their anger and frustration.

The equation in Thursday's Edexcel exam was on the probability of taking two orange sweets from a bag.

By the afternoon the topic was trending on Twitter and online petitions were set up calling on the board to lower the grade boundaries when marking.

Edexcel's owner Pearson said it aimed to "test the full range" of abilities.

But it said it would ensure students were "treated fairly" when the papers are marked.

It is understood that Edexcel stands by the difficulty level of the exam paper, and that the sweets question was targeted at students aiming for A and A* grades.

Some pupils complained the sweets question appeared to be of a higher standard than those in past papers they had used to revise.

One student, writing on the Change.org petition website, said: "All past papers were similar in a way and they are the resources... that were used by students all through the country to help them with this paper... a lot of people have done badly and would appreciate a retake of a new test or lower grade boundaries."

About 500,000 teenagers sat the exam across England, and some took to Twitter to say they felt all was going well until they began the second paper in the maths non-calculator exam.

Image copyright Other

Image copyright Other

Image copyright Other

Image copyright other

The question that attracted the most comments was about a girl called Hannah taking a sweet from a bag at random, and the students were asked to prove the equation: "Show that n²-n-90=0".

But others also highlighted questions where they were asked about the cheapest plants at a garden centre, and the volume of two pieces of cheese, as being particularly difficult.

Some of the students are also about to sit an Edexcel statistics paper and they took to Twitter again later to speculate on whether it would prove as challenging.

Media playback is unsupported on your device Media caption Rob Eastaway shows the solution to the 'impossible' maths problem

A Pearson spokesperson said: "Our exam papers are designed by an experienced team of expert teachers with a deep understanding of the subject matter.

"They make sure our papers are set at the appropriate level to test the full range of students' abilities.

"In the event that any one paper turns out to be more or indeed less challenging than usual, our marking and grading process always ensures students are awarded the grades they deserve."

Ofqual, which regulates exams in England, said it had not been contacted over the Edexcel exam.

Even if Ofqual were contacted, it would expect Edexcel to investigate and deal with any issues in the first instance.

It is understood that Edexcel has only received one formal complaint about the paper so far, and this came from a teacher.

Image copyright Empics

Image copyright Other