_This kata is based on [Project Euler Problem 546](https://projecteuler.net/problem=546)_
# Objective
Given the recursive sequence 
fk(n) =
∑
i
=
0
n
fk(floor(i / k)) where fk(0) = 1
Define a function `f` that takes arguments `k` and `n` and returns the nth term in the sequence fk
## Examples
`f(2, 3)` = f2(3) = 6
`f(2, 200)` = f2(200) = 7389572
`f(7, 500)` = f7(500) = 74845
`f(1000, 0)` = f1000(0) = 1
**Note:** 
No error checking is needed, `k` ranges from 2 to 100 and `n` ranges between 0 and 500000 (mostly small and medium values with a few large ones)
As always any feedback would be much appreciated
def f(k, n):
    g,r,c = [],1,0
    for i in range(n//k):
        c += k*r
        g.append(r)
        r += g[(i+1)//k]
    return c+r*(n%k+1)
def f(k, n):
    g,r,c = [],1,0
    for i in range(n//k):
        c += k*r
        g.append(r)
        r += g[(i+1)//k]
    return c+r*(n%k+1)