OFFSET
0,4
COMMENTS
arctan(x) = x - x^3/3 + x^5/5 - x^7/7 + ...
LINKS
Wikipedia, p-adic number
FORMULA
a(n) = (Sum_{i=0..floor((n-3)/4)} (-1)^i*4^(2*i+1)/(2*i+1)) mod 2^n.
EXAMPLE
a(3) = 4^1 mod 2^3 = 4;
a(6) = 4^1 mod 2^6 = 4
a(7) = (4^1 - 4^3/3) mod 2^7 = 68;
a(10) = (4^1 - 4^3/3) mod 2^10 = 324;
a(11) = (4^1 - 4^3/3 + 4^5/5) mod 2^11 = 324;
a(14) = (4^1 - 4^3/3 + 4^5/5) mod 2^14 = 2372;
a(15) = (4^1 - 4^3/3 + 4^5/5 - 4^7/7) mod 2^15 = 18756.
a(18) = (4^1 - 4^3/3 + 4^5/5 - 4^7/7) mod 2^18 = 182596.
PROG
(PARI) a(n) = lift(sum(i=0, (n-3)/4, Mod((-1)^i*4^(2*i+1)/(2*i+1), 2^n)))
CROSSREFS
KEYWORD
nonn
AUTHOR
Jianing Song, Aug 16 2019
STATUS
approved