OFFSET
0,3
COMMENTS
arctanh(x) = x + x^3/3 + x^5/5 + x^7/7 + ...
LINKS
Wikipedia, p-adic number
FORMULA
a(n) = (Sum_{i=0..floor(n/2)-1} 2^(2*i+1)/(2*i+1)) mod 2^n.
EXAMPLE
a(2) = 2^1 mod 2^2 = 2;
a(3) = 2^1 mod 2^3 = 2;
a(4) = (2^1 + 2^3/3) mod 2^4 = 2;
a(5) = (2^1 + 2^3/3) mod 2^5 = 26;
a(6) = (2^1 + 2^3/3 + 2^5/5) mod 2^6 = 58;
a(7) = (2^1 + 2^3/3 + 2^5/5) mod 2^7 = 122.
PROG
(PARI) a(n) = lift(sum(i=0, n/2-1, Mod(2^(2*i+1)/(2*i+1), 2^n)))
CROSSREFS
KEYWORD
nonn
AUTHOR
Jianing Song, Aug 15 2019
EXTENSIONS
Offset corrected by Georg Fischer, Jun 22 2022
STATUS
approved