Digits sum and pythagorean triples We have three positive integers numbers $a,$ $b$ and $c$ (they have no common divisor), which satisfy $b^2 + c^2 = a^2.$ If $s \le 12$ is the sum of the digits of $a,$ $b$ and $c,$ I have to calculate $a,$ $b$ and $c.$
First, $a,$ $b$ and $c$ form a primitive Pythagorean triple, that means $(a,b,c) = (m^2 + n^2,2mn,m^2-n^2),$ with $m>n$. Then I found some informations about the digits sum:
A digit sum $s_b (n) $ is a sum of the base-$b$ digits of $n$. The digit sum of a given integer is the sum of all its digits (e.g. the digit sum of $84001$ is calculated as $8+1+0+0+1=13$). Digit sums are most often computed using the decimal representation of the given number, but they may be calculated in any other base. Different bases give different digit sums, with the digit sums for binary being on average smaller than those for any other base. The digit sum of a number $x$ in base $b$ is given by: $$\sum_{n=0}^{⌊\log_b⁡x ⌋} \frac {1}{b^n} [x(\mod b^{n+1}) – x(\mod b^n)].$$ The digits sum $s_b (n) $ satisfies the congruence
$n ≡ s_b (n) (\mod ⁡b-1) $.
In base $10$, this congruence is the basis of casting out nines and of fast divisibility tests such as those for $3$ and $9$. The digits sum $s_b (n) $ satisfies the following unexpected identity
$$\sum_{n=1}^{\infty} \frac { s_b (n) }{ n(n+1)} = \frac {b}{b-1} \ln b.$$
We define $f(d,n) $ to be the number of integers of up to $d$ decimal digits with digit sum less than or equal to $n$. It can be seen that this function is given by the formula
$$f(d,n)=\sum_{i=0}^d(-1)^i\binom{d}i\binom{n+d-10i}d\;.$$
How can I use the above formulas? Thank you
 A: This is only a start, not a complete solution, but it's way too long for a comment.  I'm still working on this, and I hope that others will provide suggestions, or perhaps be able to extend these ideas into a solution.
First, you omitted a couple of facts about the $m$ and $n$ that generate primitive Pythagorean triples.  ("Primitive" means that $a,b,c$ are pairwise relatively prime.) First, $m,n$ must be coprime.  Second one must be even, and one must be odd.  Note that the second fact implies that $c$ is odd.
The important fact about the digit sum of a number is congruent to the original number, modulo $9.$  (This is the basis of "casting out nines.")  So we know that $$a+b+c\equiv3\pmod9$$  So far I'm only considering the $s=12$ case.  That's really just because of confusion on my part, but I'm sure we can rule out some of the smaller values based on size considerations like those below.
I used these facts to write a little python script to compute the possible values of $(a,b,c)\pmod9.$
for a in range(9):
    for b in range(a,9):        
        for c in range(9):
            if (c*c-a*a-b*b)%9 == 0 and (a+b+c)%9==3:
                if a%3==0 and b%3==0: continue
                print(a,b,c)

This produced the output
1 3 8
2 3 7
3 4 5
3 5 4
3 7 2
3 8 1

Note that each line represents two possibilities.  For example the first line represents both
$$a\equiv1\pmod9,b\equiv3\pmod9,c\equiv8\pmod9$$
and 
$$a\equiv3\pmod9,b\equiv1\pmod9,c\equiv8\pmod9$$ 
Consider the last line, where $c\equiv1\pmod9$  The digit sum of $c$ must be either $1$ or $10$ since we know it's $\le12$.  If it is $1$, then $c=10^n$ for some $n>1$ which is impossible, since $c$ is odd.  On the other hand, if the digit sum is $10$, then both $a$ and $b$ are powers of $10$ so not relatively prime.  (We know that $1$ is not a member of any Pythagorean triple.) 
Therefore, we can eliminate the last possibility.  In the other cases, considerations of size lead to the conclusion that the numbers shown are the actual digit sums, not merely the congruence classes.
So far, I haven't been able to rule out any additional lines, nor to see how to find the general solution for lines that can't be ruled out.  
EDIT
I updated my python script to consider $s<12$.  I also included the facts that the digit sum can never be $0$ and in the case of $c$ it can't be $1$ as shown above.  Here's the new script:
for s in range(13):
    for a in range(1,9):
        for b in range(a,9): 
            if a%3==0 and b%3==0: continue
            for c in range(2,9):
                if (c*c-a*a-b*b)%9 == 0 and a+b+c==s:
                    print(a,b,c)

This produced the output:
2 3 2
2 6 2
3 4 4
1 3 8
2 3 7
3 4 5
3 5 4
3 7 2

EDIT
I tried out the suggestion of qwr, namely looking at the last two digits of $a,b,c$.  Taking $a$ to be even and $b$ to be odd leaves me $62$ possibilities.  I think I see how to eliminate a number of them, but it doesn't look very promising overall.   
