Triples

Let m and n be two positive integers, 5 ≤ m ≤ 100, 2 ≤ n ≤ 100. Consider the following sets of triples:

Tm,j = {(x, y, z) ∈ ℕ3 | x ≤ y ≤ z ≤ m and xj + yj = zj}, j = 2…n

The problem asks you to compute the sum:

Sm,n = ∑ card(Tm,j), 2 ≤ j ≤ n.

Notes:

  • ℕ is the set of non-negative integers (ℕ = {0, 1, 2, …}).
  • card(Tm,j) is the number of elements of the set Tm,j.

Input

The input contains several test cases. Each test case occupies exactly two lines of input: the first line contains integer m, and the second line contains integer n. Tests should be read until the end of file is reached.

Output

For each test case, the result will be written to standard output, on a line by itself.

Sample

InputOutput
85
95
8128
Questions?

Sponsors Gold