# Solution of;
# Project Euler Problem 586: Binary Quadratic Form
# https://projecteuler.net/problem=586
# 
# The number 209 can be expressed as $a^2 + 3ab + b^2$ in two distinct ways:$ 
# \qquad 209 = 8^2 + 3\cdot 8\cdot 5 + 5^2$ $ \qquad 209 = 13^2 + 
# 3\cdot13\cdot 1 + 1^2$Let $f(n,r)$ be the number of integers $k$ not 
# exceeding $n$ that can be expressed as $k=a^2 + 3ab + b^2$, with $a\gt b>0$ 
# integers, in exactly $r$ different ways. You are given that $f(10^5, 4) = 
# 237$ and $f(10^8, 6) = 59517$. Find $f(10^{15}, 40)$.
# 
# by lcsm29 http://github.com/lcsm29/project-euler
import timed


def dummy(n):
    pass


if __name__ == '__main__':
    n = 1000
    i = 10000
    prob_id = 586
    timed.caller(dummy, n, i, prob_id)
