A334958 GCD of consecutive terms of the factorial times the alternating harmonic series.
1, 1, 1, 2, 2, 12, 12, 48, 144, 1440, 1440, 17280, 17280, 241920, 18144000, 145152000, 145152000, 2612736000, 2612736000, 10450944000, 219469824000, 4828336128000, 4828336128000, 115880067072000, 579400335360000, 15064408719360000, 135579678474240000, 26573616980951040000, 26573616980951040000
Offset: 1
Keywords
Examples
A024167(4) = 4!*(1 - 1/2 + 1/3 - 1/4) = 14, A024167(5) = 5!*(1 - 1/2 + 1/3 - 1/4 + 1/5) = 94, A024168(4) = 4!*(1/2 - 1/3 + 1/4) = 10, and A024168(5) = 5!*(1/2 - 1/3 + 1/4 - 1/5) = 26. Then a(4) = gcd(14, 94) = gcd(10, 26) = gcd(14, 4!) = gcd(10, 4!) = gcd(14, 10) = 2.
Crossrefs
Programs
-
Maple
b:= proc(n) b(n):= (-(-1)^n/n +`if`(n=1, 0, b(n-1))) end: a:= n-> (f-> igcd(b(n)*f, f))(n!): seq(a(n), n=1..30); # Alois P. Heinz, May 18 2020
-
Mathematica
b[n_] := b[n] = -(-1)^n/n + If[n == 1, 0, b[n-1]]; a[n_] := GCD[b[n] #, #]&[n!]; Array[a, 30] (* Jean-François Alcover, Oct 27 2020, after Alois P. Heinz *)
-
SageMath
def A(): a, b, n = 1, 1, 2 while True: yield gcd(a, b) b, a = a, a + b * n * n n += 1 a = A(); print([next(a) for in range(29)]) # _Peter Luschny, May 19 2020
Comments