login
A307233
a(n) = Product_{k=1..n} (k^2 + k + 1) mod n.
0
0, 1, 0, 1, 3, 3, 0, 1, 0, 9, 3, 9, 0, 7, 12, 1, 3, 9, 0, 1, 0, 9, 3, 9, 18, 13, 0, 21, 3, 9, 0, 1, 27, 9, 7, 9, 0, 19, 0, 1, 3, 21, 0, 37, 18, 9, 3, 33, 0, 49, 27, 13, 3, 27, 12, 49, 0, 9, 3, 21, 0, 31, 0, 1, 13, 3, 0, 13, 27, 49, 3, 9, 0, 37, 57, 57, 42
OFFSET
1,5
FORMULA
a(n) = A130032(n) mod n.
If prime p == 1 mod 3, a(p) = 0; if p == 2 mod 3, a(p) = 3 for prime p > 3.
a(A002061(k)) = 0.
If a(j) = a(k) = 0, then a(j*k) = 0.
EXAMPLE
a(4) = 1 since 3*7*13*21 = 1 mod 4.
MATHEMATICA
Table[Mod[Product[k^2+k+1, {k, 0, n}], n], {n, 1, 100}]
PROG
(PARI) a(n) = prod(k=1, n, k^2+k+1) % n
CROSSREFS
Sequence in context: A283386 A278385 A245626 * A233320 A163535 A288395
KEYWORD
nonn,easy
AUTHOR
Jinyuan Wang, Apr 14 2019
STATUS
approved