Divisors [III]
Divisors [III]
The blurb for this problem is the same as Divisors [I], save for the statement of the problem.
Consider the sequence of all natural numbers, and then for each number, listing each of the divisors of this number in increasing order:
123456…becomes:
11213124151236…Since this (infinite) sequence has a lot of duplicates, we can notate for each digit whether it is the first, second, third... occurence using a subscript:
1112211331142241155116233261…For this third problem, we are considering taking the reciprocal of every value in this sequence, and summing it:
11+11+21+11+31+11+21+41…For this problem, we want you to estimate the value of the partial sum up to and including some i1 (The first occurence of some value i)
Input
Input will contain a single value i, representing the sequence value i1
Output
Output an estimate of the partial sum up to and including the first occurence of i1.
In order to receive 30% of the grade, your solution should have maximum error at most ln(i).
In order to be judged as correct and receive full marks, your solution should have maximum error at most i1+2i<svg xmlns="http://www.w3.org/2000/svg" width="400em" height="1.08em" viewBox="0 0 400000 1080" preserveAspectRatio="xMinYMin slice"><path d="M95,702 c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14 c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54 c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10 s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429 c69,-144,104.5,-217.7,106.5,-221 l0 -0 c5.3,-9.3,12,-14,20,-14 H400000v40H845.2724 s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7 c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z M834 80h400000v40h-400000z"></svg>ln(1+ilni)+i<svg xmlns="http://www.w3.org/2000/svg" width="400em" height="1.08em" viewBox="0 0 400000 1080" preserveAspectRatio="xMinYMin slice"><path d="M95,702 c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14 c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54 c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10 s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429 c69,-144,104.5,-217.7,106.5,-221 l0 -0 c5.3,-9.3,12,-14,20,-14 H400000v40H845.2724 s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7 c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z M834 80h400000v40h-400000z"></svg>∗2−55+log2(i). For reference, this error looks like the following (note the logarithmic axis):

Constraints
- 1≤i≤1011
Example
5
6.783333333333333
Although anything ±1.447997 from this answer would suffice.
Comments0
No comments yet
Be the first to comment.
New comment
Log in to join the discussion.