<s>[INST] divisibility test let $n=a_m 10^m+a_{m-1}10^{m-1}+\dots+a_2 10^2+a_1 10+a_0$, where $a_k$'s are integer and $0\le a_k\le 9$, $k=0,1,2,\dots,m$, be the decimal representation of $n$
let $S=a_0+\dots+a_m$, $T=a_0-a_1\dots+(-1)^ma_m$
then could any one tell me how and why on the basis of divisibility of $S$ and $T$ by $2,3,\dots,9$  divisibility of $n$ by $2,3,\dots,9$ depends?
I am not getting the fact why we introduce $S,T$
same question $n=a_m (100)^m+a_{m-1}(1000)^{m-1}+\dots+a_2 1000^2+a_1 1000+a_0$,
$0\le a_k\le 999$
 [/INST] The presence of many subscripts can make something simple look not so simple. So we deal with a number like $N=a_4\cdot 10^4+a_3\cdot 10^3 +a_2\cdot 10^2 +a_1\cdot 10^1+a_0$, where the $a_i$ are digits. Let $S=a_4+a_3+a_2+a_1+a_0$. 
We have 
$$N-S=a_4\cdot 9999+a_3\cdot 999+a_2\cdot 99+a_1\cdot 9.\tag{1}$$
The right-hand side of (1) is divisible by $3$, Thus $N-S$ is divisible by $3$. It follows that if $N$ is a multiple of  $3$, then so is $S$, and that if $S$ is a multiple of  $3$, then so is $N$.
It is easier to find out quickly whether $S$ is a multiple of $3$ than to find out whether $N$ is a multiple of $3$, so finding $S$ is a useful way to determine whether $N$ is a multiple of $3$.
Exactly the same holds for divisibility by $9$. The right-hand side of (1) is divisible by $9$, so $N$ is divisible by $9$ if and only if $S$ is divisible by $9$.
We illustrated the idea with a general $5$-digit number. But the same technique always works, for the same reason: $10^k-1$ is always divisible by $9$, 
The numbers $S$ and $T$, by themselves, are not enough to determine divisibility by any of $2$, $4$, $5$, $6$, $7$, or $8$.
The usefulness of the number $T$ is that $N$ is divisible by $11$ if and only if $T$ is. Once you are comfortable with $S$ and $3$ and $9$, please leave a message and I can try to explain what $T$ has to do with divisibility by $11$. The idea is quite similar to the idea we have used, just a bit more messy.
</s>