Set[$MinPrecision, 20]

Sum[(4/(8  i + 1) - 2/(8  i + 4)  -  1/(8  i + 5) - 
              1/(8  i + 6))*16^(-i), {i, 0, 
          7}]//N

16*%

d=4

m=20

SetPrecision[(∑_(i = 0)^d)((4/(8  i + 1) - 
                  2/(8  i + 4)  -  1/(8  i + 5) - 
                  1/(8  i + 6))*16^(2 - 
                    i))  + (∑_(i = d + 1)^m)((4/(8  i + 
                        1) - 2/(8  i + 4)  -  1/(8  i + 5) - 
                  1/(8  i + 6))/16^(i - 2)),  25]

Result  = 
      SetPrecision[(∑_(i = 0)^d)(4*
                  PowerMod[16, d - i, 8  i + 1]/(8  i + 1) - 
                2*PowerMod[16,  d - i, (8  i + 4)]/(8  i + 4)  -  
                PowerMod[16, d - i, (8  i + 5)]/(8  i + 5) - 
                PowerMod[16, 
                    d - i, (8  i + 6)]/(8  i + 
                      6))  + (∑_(i = d + 1)^m)((4/(8  i + 
                          1) - 2/(8  i + 4)  -  1/(8  i + 5) - 
                    1/(8  i + 6))/16^(i - d)),  25]

Fraction = Result - Floor[Result]

16^d*Pi//N

RealDigits[Pi,16, 25]

RealDigits[16^3*Fraction,16,3]