ForHosting KIT · Home, food & hobbies

Harmonic series

The first ten terms of the harmonic series add up to 2.928968253968, just under three, even though each new fraction is smaller than the last. Pick how many terms to add and get the exact partial sum for homework or a puzzle. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon
If you enter
N
10
You get
Sum
2.928968254

The harmonic series is the sum of the reciprocals of the positive integers: one plus one half plus one third and onward without a last term. Its finite prefixes, the harmonic numbers H_n, grow without bound yet only about as fast as the natural logarithm of n. Students meet H_n when they first study divergence of series; puzzle solvers and programming-kata fans meet it when they need a slow-growing reference sequence; engineers meet it when they bound nested loops that do a little extra work on every prefix.

What H_n is and why the infinite series has no last total

The nth harmonic number is defined as H_n equals the sum from k equals one to n of one over k. That is the finite prefix of the classical harmonic series one plus one half plus one third and so on, a series that diverges even though its terms shrink toward zero. For n equals one the sum is exactly one.

For n equals two it is one and a half. For n equals four it is a little over two, and by n equals ten the total sits near two point nine two nine. Those early values are the ones textbooks use to show that terms going to zero is not enough for a series to converge: each new reciprocal is smaller than the last, yet the running total still creeps upward with no finite limit.

The same partial sums appear in integral comparison tests, in bounding nested loops that visit one plus one half plus one over n work units, and in coupon-collector sketches whose expectation is n times H_n. Hobbyists who study overtones will hear a related word in music, but this calculator is the discrete reciprocal sum, not a frequency table of string harmonics.

Because the infinite series has no finite total, software never returns a closed value for the whole series: it always returns a partial sum indexed by a positive integer n.

Where a harmonic partial-sum tool earns its keep

Hobby classrooms and tutoring sessions use a harmonic series calculator so learners can explore growth rates without writing their first for-loop under time pressure. Programming-kata and interview-prep sites use H_n to discuss big-O intuition: the sum of one over k is Theta of log n, which explains why some nested algorithms feel almost linear yet still outgrow constant factors. Puzzle designers sometimes embed harmonic prefixes when they want a slowly increasing score table, a diminishing-return curve, or a coupon-style expected-trial count without pulling a full math library.

Failed validation does not consume balance.

Classroom and tutoring checks

Let students request H_n for increasing n and watch slow logarithmic growth without writing the summation loop themselves.

Programming katas and complexity notes

Show that summing one over k tracks log n when explaining nested loops, coupon-collector sketches, or harmonic bounds in analysis notes.

What happens if n is not a positive integer?

Harmonic numbers are defined for positive integers only, so zero, negatives, fractions, and missing n are rejected without charge.

How is the sum rounded?

Reciprocals are added from 1/n up to 1 and the result is rounded to twelve decimal places for cross-runtime reproducibility. It is not an exact rational fraction.

Is there a maximum n I can send?

Yes. n must be at most one million so runtime stays bounded.

Does the harmonic series converge?

No. Its terms shrink toward zero, yet the running total keeps creeping upward with no finite limit, growing roughly as fast as the natural logarithm of the number of terms.

What is the sum of the first ten harmonic terms?

About 2.928968253968, just under three. One plus one half plus one third and so on through one tenth climbs slowly, which is why the series looks tame while still growing forever.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/hobby/harmonic-series

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.

curl -X POST https://api.kit.forhosting.com/hobby/harmonic-series \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"n":10}'
{
  "n": 10
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "hobby.harmonic_series",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

max_n1000000
HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

If n is missing, not an integer, or not strictly positive, the task fails with invalid_input and is not billed.

What H_n is and why the infinite series has no last total

This capability implements that object with a deterministic loop of reciprocal additions, a hard upper bound on n so edge runtime stays predictable, and a response that echoes n, reports a stably rounded sum, and restates the formula so logs and lesson materials can display the request without reconstructing it from scratch.

Input contract, summation order, rounding, and errors

On success the body contains n, sum, and formula. If you need a reduced exact fraction such as a numerator over a denominator, this capability is not a computer-algebra system; it returns a floating-point partial sum only. The formula field restates H_n in a human-readable string so a UI can show the series next to the number without extra formatting code. POST a JSON body with a single required field n: a positive integer greater than or equal to one and at most one million. The field may also arrive under the alias terms. Values below one, non-integers, missing fields, empty strings, and n above the published maximum fail with invalid_input naming the field, and those failures are not billed. Twelve digits is more than enough for classroom checks, puzzle write-ups, and most engineering estimates while remaining a clean JSON number. Pair it with your own rational arithmetic when a proof requires fractions, and use this endpoint when you need a fast, auditable numeric H_n in worksheets, katas, or small automation.

Where a harmonic partial-sum tool earns its keep

Bound n, keep the request small, and you get a reproducible number you can pin in tests, notebooks, and edge workers.

Puzzle scores and test fixtures

Pin H_n in a hobby game table, worksheet, or integration test when you need a stable harmonic partial sum as a reference constant.

What does this harmonic series tool return?

It returns the nth partial sum H_n = 1 + 1/2 + … + 1/n as a floating-point number, together with n and a short formula string. Send a positive integer n.

What does a harmonic series partial-sum call cost?

The browser tool is free. API requests use prepaid balance at $0.002 per successful call; invalid input is not billed.

Read the full KIT documentation →