Problem 52936. Easy Sequences 39: Perfect Squares in Pascal's Triangle
We can see that on the 2nd, 3rd, 4th, 5th and 10th rows, the highlighted diagonals contains at least one perfect square elements:
- 2nd Diagonal:
- 3rd Diagonal:
- 4th Diagonal:
Given a row limit r, write a function that outputs a set of row numbers , in which the 2nd, 3rd and 4th diagonals of the pascal's triangle contains at least one perfect square elements.
In the case above where
, the function should return
.
Solution Stats
Problem Comments
-
2 Comments
Tim
on 13 Oct 2021
Test case 5 seems to be missing solutions 1683 and 57123, and test cases 6 and 7 seem to be missing those plus 1940451 and 65918163.
Ramon Villamangca
on 14 Oct 2021
HI Tim, Corrected it. Thanks.
Solution Comments
Show commentsProblem Recent Solvers6
Suggested Problems
-
Find the sum of all the numbers of the input vector
50448 Solvers
-
It's going down. We're finding simbers!
76 Solvers
-
Find two triangular numbers whose sum is input.
97 Solvers
-
97 Solvers
-
Easy Sequences 8: Triangles with integer sides and prime perimeters
9 Solvers
More from this Author116
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!