HACKER Q&A
📣 techsin101

Is there a math formula that can give me nth pie digit?


I want to make a function that gives me nth pie digit without calculating it from 1st digit.

So getNthPie(2) -> 4

and getNthPie(1000000) -> 4


  👤 version_five Accepted Answer ✓
There are BBP formulas. I don't know if they work in decimal though

Update: only in hex: https://en.m.wikipedia.org/wiki/Bailey%E2%80%93Borwein%E2%80...