HelpContactFor teachers and institutes
>_StemPy Lab
Mock TestsClasses

>_StemPy Lab

Learn. Solve. Code the solutions. Test yourself.

Live examsFree mock exams, timed and rankedEveryone starts together, and your score and rank come the moment it ends.See the exams →
Live examsInternational live exams are comingTell us which exam you want first. Timed practice papers are open now.See what is coming →

Learn

  • Physics
  • Chemistry
  • Mathematics
  • Biology
  • Python Programming
  • Statistics & Data Science
  • Computer Science
  • Space Science and Astronomy
  • Classes
  • Groups

Practice

  • Problems
  • Quizzes
  • Mock Tests
  • Prepare for an Exam
  • Question Sets
  • Exams
  • Certificates
  • Python Labs
  • AI Practice Generator
  • Student-Created Tests

Community

  • Discussions
  • Resources
  • Notes
  • Glossary
  • Blog

Account

  • Log in
© 2026 senLearn. All rights reserved.HelpFor SchoolsAboutContactPrivacy PolicyTerms of UseRefund Policy
  1. Problems
  2. /Find all positive whole numbers n for which n² + 5n + 30 is a perfect square…
AdvancedMathematicsHigh School (11–12)Number TheoryConceptualNumericalOlympiad

Find all positive whole numbers n for which n² + 5n + 30 is a perfect square…

StemPy LabContributed by StemPy Lab

Try it on paper first. A hint, the key idea and the worked solution are here when you need them.

Find all positive whole numbers nnn for which n2+5n+30n^2 + 5n + 30n2+5n+30 is a perfect square.

  1. Show that for large nnn the number lies strictly between (n+2)2(n + 2)^2(n+2)2 and (n+3)2(n + 3)^2(n+3)2. Find exactly which nnn this holds for.
  1. Check the remaining values of nnn and list the solutions.
  1. Give the number of solutions and their sum.

Check your answer

Work it out on paper, then type your number. The answer itself stays hidden.

Need a reminder? The key ideaShowHide

In base bbb the digits are remainders of repeated division by bbb. abc‾=100a+10b+c\overline{abc} = 100a + 10b + cabc=100a+10b+c. Squares leave 0,10, 10,1 on division by 444 and 0,1,4,70, 1, 4, 70,1,4,7 on division by 999. No square lies strictly between m2m^2m2 and (m+1)2(m + 1)^2(m+1)2.

The worked solution

Check an answer or open a hint to unlock the worked solution.

Have you tried it?

Work it out on paper first. It is fine to get stuck or make a mistake: that is how we learn. When you are ready, go through the solution one step at a time, and check each step against your own.

Step 1. Part (a). n2+5n+30>n2+4n+4=(n+2)2n^2 + 5n + 30 > n^2 + 4n + 4 = (n + 2)^2n2+5n+30>n2+4n+4=(n+2)2 for every n≥1n \ge 1n≥1. And n2+5n+30<n2+6n+9n^2 + 5n + 30 < n^2 + 6n + 9n2+5n+30<n2+6n+9 exactly when n>21n > 21n>21. So for n≥22n \ge 22n≥22 the number is strictly between two consecutive squares and is not a square.

Step 2. Part (b). For 1≤n≤211 \le n \le 211≤n≤21, the square is (n+k)2(n + k)^2(n+k)2 with k≥3k \ge 3k≥3. Then n2+5n+30=n2+2kn+k2n^2 + 5n + 30 = n^2 + 2kn + k^2n2+5n+30=n2+2kn+k2, so n=30−k22k−5n = \dfrac{30 - k^2}{2k - 5}n=2k−530−k2​.

  • k=3k = 3k=3: n=211=21n = \dfrac{21}{1} = 21n=121​=21.
  • k=4k = 4k=4: n=143n = \dfrac{14}{3}n=314​, not whole.
  • k=5k = 5k=5: n=55=1n = \dfrac{5}{5} = 1n=55​=1.
  • k≥6k \ge 6k≥6: the top is negative.

Step 3. Check. n=1n = 1n=1: 1+5+30=36=621 + 5 + 30 = 36 = 6^21+5+30=36=62. n=21n = 21n=21: 212+5×21+30=576=24221^2 + 5 \times 21 + 30 = 576 = 24^2212+5×21+30=576=242.

Answer: n=1n = 1n=1 and n=21n = 21n=21: two solutions, with sum 222222.

Log in to save this for later
← All Problems
← Prove that 121b is a perfect square in every base b ≥ 3…A puzzle card asks for two remainders without a calculator… →
More onNumber Theory

Discussion (0)

Log in to join the discussion.

Loading…

More on this topic

  1. The triangular numbers are 1, 3, 6, 10, …, where the nth one is (n(n + 1))/2…Advanced
  2. Prove that the equation x³ + y³ + z³ = n has no solution in integers when n leaves remainder 4 or 5…Advanced
  3. Find every triple of positive integers a ≤ b ≤ c with 1/a + 1/b + 1/c = 1, and prove that there are…Advanced
  4. Find all pairs of positive integers (x, y) with x² - y² = 945…Hard
  5. A teacher wants a list of every primitive Pythagorean triple whose hypotenuse is less than 100…Advanced
All problems on this topic →