--- id: 6a22d77ddf034bc4e35b1d58 title: "Challenge 351: Pronic Number" challengeType: 29 dashedName: challenge-351 --- # --description-- Given a number, determine whether it is a pronic number. A pronic number is the product of two consecutive integers. For example, 6 is pronic because 2 * 3 = 6. # --hints-- `is_pronic(6)` should return `True`. ```js ({test: () => { runPython(` from unittest import TestCase TestCase().assertIs(is_pronic(6), True)`) }}) ``` `is_pronic(15)` should return `False`. ```js ({test: () => { runPython(` from unittest import TestCase TestCase().assertIs(is_pronic(15), False)`) }}) ``` `is_pronic(12)` should return `True`. ```js ({test: () => { runPython(` from unittest import TestCase TestCase().assertIs(is_pronic(12), True)`) }}) ``` `is_pronic(132)` should return `True`. ```js ({test: () => { runPython(` from unittest import TestCase TestCase().assertIs(is_pronic(132), True)`) }}) ``` `is_pronic(80)` should return `False`. ```js ({test: () => { runPython(` from unittest import TestCase TestCase().assertIs(is_pronic(80), False)`) }}) ``` `is_pronic(0)` should return `True`. ```js ({test: () => { runPython(` from unittest import TestCase TestCase().assertIs(is_pronic(0), True)`) }}) ``` # --seed-- ## --seed-contents-- ```py def is_pronic(n): return n ``` # --solutions-- ```py def is_pronic(n): k = int(n ** 0.5) return k * (k + 1) == n ```