Let me explain this rule by taking examples
consider number 34568276, we have to calculate the reminder on diving this number by 27 and 37 respectively.
make triplets as written below starting from units place
34.........568..........276
now sum of all triplets = 34+568+276 = 878
divide it by 27 we get reminder as 14
divide it by 37 we get reminder as 27
Example.
other examples for the clarification of the rule
let the number is 2387850765
triplets are 2...387...850...765
sum of the triplets = 2+387+850+765 = 2004
on revising the steps we get
2......004
sum = 6
divide it by 27 we get reminder as 6
divide it by 37 we get reminder as 6