Compute the harmonic numbers - MATLAB Cody - MATLAB Central

Problem 46000. Compute the harmonic numbers

Difficulty:Rate
The nth harmonic number is defined as the sum of the reciprocals of the integers from 1 to n:
Definition of the harmonic numbers: sum(1/k) from k = 1 to k = n
The first four harmonic numbers are 1, 3/2, 11/6, and 25/12. The harmonic numbers appear in several interesting identities, including this one for Apery's constant:
Relation between zeta(3) and the harmonic numbers
Compute the nth harmonic number.

Solution Stats

65.22% Correct | 34.78% Incorrect
Last Solution submitted on Apr 03, 2025

Problem Comments

Solution Comments

Show comments
PIVlab surpasses 100K all-time File Exchange downloads
During the past twelve months, PIVlab, a MATLAB Community Toolbox for particle...
4
8

Problem Recent Solvers83

Suggested Problems

More from this Author298

Problem Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!