As explained in Cody Problem 60571, a polygonal number is the number of dots arranged in the shape of a regular polygon. For example, 15 is a triangular number because dots can be arranged in the shape of a triangle with rows of 1, 2, 3, 4, and 5 dots. The number 16 is a square number because dots can be arranged in four rows of four.
Write a function to sum the reciprocals of polygonal numbers. In particular, compute
where
is the nth s-gonal number (i.e., the nth number corresponding to a regular polygon with s sides).
Solution Stats
Solution Comments
Show comments
Loading...
Problem Recent Solvers7
Suggested Problems
-
596 Solvers
-
Omit columns averages from a matrix
620 Solvers
-
Sum all integers from 1 to 2^n
18055 Solvers
-
Project Euler: Problem 8, Find largest product in a large string of numbers
1329 Solvers
-
Number of 1s in a binary string
11552 Solvers
More from this Author328
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!