Given integer n and float z find sum s of modulo z of first n natural numbers i.e 1%z + 2%z + ... + n%z. Note that z is irrational number!
$$ s=\sum_{i=1}^n {(i\mod z)} \\ z \ is \ irrational $$
For my concrete case z is $$ {\sqrt 2+1}$$
I found similar problem: https://www.geeksforgeeks.org/find-sum-modulo-k-first-n-natural-number
For my case n could be bigger than 10^100, so naive linear time solution would not work.