OFFSET
1,5
LINKS
FORMULA
a(n) = floor(n!*log(2)) - n*floor((n-1)!*log(2)).
EXAMPLE
log(2) = 0 + 1/2! + 1/3! + 0/4! + 3/5! + 1/6! + 0/7! + 3/8! + 6/9! + ...
MATHEMATICA
With[{b = Log[2]}, Table[If[n == 1, Floor[b], Floor[n!*b] - n*Floor[(n - 1)!*b]], {n, 1, 100}]] (* G. C. Greubel, Nov 26 2018 *)
PROG
(PARI) default(realprecision, 250); b = log(2); for(n=1, 80, print1(if(n==1, floor(b), floor(n!*b) - n*floor((n-1)!*b)), ", ")) \\ G. C. Greubel, Nov 26 2018
(Magma) SetDefaultRealField(RealField(250)); [Floor(Log(2))] cat [Floor(Factorial(n)*Log(2)) - n*Floor(Factorial((n-1))*Log(2)) : n in [2..80]]; // G. C. Greubel, Nov 26 2018
(Sage)
def A067882(n):
if (n==1): return floor(log(2))
else: return expand(floor(factorial(n)*log(2)) - n*floor(factorial(n-1)*log(2)))
[A067882(n) for n in (1..80)] # G. C. Greubel, Nov 26 2018
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Benoit Cloitre, Mar 10 2002
STATUS
approved