login
A231333
a(n) = lcm_{p is a prime divisor of n} (n/p - 1).
1
1, 0, 0, 1, 0, 2, 0, 3, 2, 4, 0, 15, 0, 6, 4, 7, 0, 40, 0, 9, 6, 10, 0, 77, 4, 12, 8, 39, 0, 630, 0, 15, 10, 16, 12, 187, 0, 18, 12, 133, 0, 260, 0, 21, 56, 22, 0, 345, 6, 72, 16, 75, 0, 442, 20, 189, 18, 28, 0, 6061, 0, 30, 40, 31, 12, 3360, 0, 33, 22, 3978
OFFSET
1,6
COMMENTS
n is prime if and only if a(n) = 0.
n is a Giuga number if and only if a(n) > 0 and n divides a(n).
LINKS
FORMULA
a(6) = 2 because 6/2 - 1 = 2 and 6/3 - 1 = 1, and the least common multiple of 2 and 1 is 2.
a(7) = 0 because 7/7 - 1 = 0.
a(8) = 3 because 8/2 - 1 = 3.
MATHEMATICA
lcm[lis_] := {aux = 1; Do[aux = LCM[aux, lis[[i]]], {i, 1, Length[lis]}]; aux}[[1]]; fa = FactorInteger; j[n_] := lcm@Table[n/fa[n][[i, 1]] - 1, {i, 1, Length[fa[n]]}] ; Array[j, 100]
PROG
(PARI) a(n)=my(f=factor(n)[, 1]); lcm(vector(#f, i, n/f[i]-1)) \\ Charles R Greathouse IV, Nov 13 2013
CROSSREFS
Cf. A007850.
Sequence in context: A057860 A092915 A063749 * A357866 A331622 A212175
KEYWORD
nonn
AUTHOR
STATUS
approved