OFFSET
1,2
COMMENTS
LINKS
Peter Luschny, Table of n, a(n) for n = 1..10000
FORMULA
a(n) divides n, n/a(n) = A326478(n).
EXAMPLE
a(559) = 1 and 559 is in A121707.
a(561) = 561 and 561 is Carmichael.
a(563) = 563 and 563 is prime.
MAPLE
db := n -> denom(bernoulli(n)): nb := n -> numer(bernoulli(n)):
a := n -> igcd(n*nb(n-1), db(n-1)): seq(a(n), n=1..80);
MATHEMATICA
a[n_] := With[{b = BernoulliB[n-1]}, GCD[n Numerator[b], Denominator[b]]];
Array[a, 80] (* Jean-François Alcover, Jul 21 2019 *)
PROG
(PARI) a(n) = my(b=bernfrac(n-1)); gcd(n*numerator(b), denominator(b)); \\ Michel Marcus, Jul 19 2019
CROSSREFS
KEYWORD
nonn
AUTHOR
Peter Luschny, Jul 19 2019
STATUS
approved