← Complete problem index

PROJECT EULER · #0586

Binary Quadratic Form

Statement only · UnsolvedOriginal problem ↗

The number 209 can be expressed as a2+3ab+b2 in two distinct ways:

209=82+385+52
209=132+3131+12

Let f(n,r) be the number of integers k not exceeding n that can be expressed as k=a2+3ab+b2, with a>b>0 integers, in exactly r different ways.

You are given that f(105,4)=237 and f(108,6)=59517.

Find f(1015,40).

Write-up coming later

The complete problem is available here. An approach, code, and answer will be added later.