問題一覧 > 通常問題

No.2645 Sum of Divisors?

レベル : / AI推定難易度 : 1700 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 小数誤差許容問題 絶対誤差または相対誤差が $10^{-6}$ 以下。ただし、ジャッジ側の都合で500桁未満にしてください
タグ : (AC するまで非表示) / 解いたユーザー数 37
作問者 : shobonvip / テスター : noya2
お気に入りにしたユーザー ProblemId : 10659 / 自分の提出
問題文最終更新日: 2024-02-19 06:30:31
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
traP 作問ハッカソンコンテスト 002(day2) (順位表) の他の問題:

Problem Statement

For a positive integer $n$, let $d(n)$ denote the number of positive divisors of $n$.

Given a positive integer $N$, find the following value.

$$\sum_{k=1}^{N} \frac{d(k)}{k}$$

Constraints

  • $1 \le N \le 10^{12}$

Input

$N$

Output

Output the value of $\sum_{k=1}^{N} \frac{d(k)}{k}$. Your output is judged as correct if its relative error or absolute error from the intended solution is at most $10^{-6}$. The intended solution is guaranteed to have an absolute error or relative error of at most $10^{-32}$ from the true value.

Sample

Sample 1
Input
6
Output
4.483333333333333

The values of $d(k)/k$, in order of $k=1,2,\dots$, are as follows.

$$\frac{d(1)}{1} = 1$$ $$\frac{d(2)}{2} = 1$$ $$\frac{d(3)}{3} = \frac{2}{3}$$ $$\frac{d(4)}{4} = \frac{3}{4}$$ $$\frac{d(5)}{5} = \frac{2}{5}$$ $$\frac{d(6)}{6} = \frac{2}{3}$$

Output their sum, $269/60 = 4.48333\cdots$.

Sample 2
Input
998244
Output
111.83577968031178
Sample 3
Input
314159265358
Output
381.4545183502939

提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。