Triples

No attempts yetTime limit5sMemory limit256 MB

Problem

Two positive integers mm and nn are given, with 5m1005 \le m \le 100 and 2n1002 \le n \le 100. For each exponent jj, define the set of triples

Tm,j={(x,y,z)N3xyzm, xj+yj=zj},j=2,3,,nT_{m,j} = \{(x, y, z) \in \mathbb{N}^3 \mid x \le y \le z \le m,\ x^j + y^j = z^j\}, \quad j = 2, 3, \dots, n

where N\mathbb{N} is the set of nonnegative integers, that is N={0,1,2,}\mathbb{N} = \{0, 1, 2, \dots\}.

Compute the sum Sm,nS_{m,n}:

Sm,n=j=2ncard(Tm,j)S_{m,n} = \sum_{j=2}^{n} \operatorname{card}(T_{m,j})

Here card(Tm,j)\operatorname{card}(T_{m,j}) is the number of elements of the set Tm,jT_{m,j}.

Input

The first line contains mm. The second line contains nn.

Output

Print the value of Sm,nS_{m,n}.