login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

A240658
Least k such that 3^k == -1 (mod prime(n)), or 0 if no such k exists.
1
1, 0, 2, 3, 0, 0, 8, 9, 0, 14, 15, 9, 4, 21, 0, 26, 0, 5, 11, 0, 6, 39, 0, 44, 24, 50, 17, 0, 0, 56, 63, 0, 68, 69, 74, 25, 39, 81, 0, 86, 0, 0, 0, 8, 98, 99, 105, 111, 0, 0, 116, 0, 60, 0, 128, 0, 134, 15, 0, 140, 141, 146, 17, 0, 0, 158, 165, 84, 0, 87, 176, 0
OFFSET
1,3
COMMENTS
The least k, if it exists, such that prime(n) divides 3^k + 1.
FORMULA
a(1) = 1; for n > 1, a(n) = A062117(n)/2 if A062117(n) is even, otherwise 0.
MATHEMATICA
Table[p = Prime[n]; s = Select[Range[p/2], PowerMod[3, #, p] == p - 1 &, 1]; If[s == {}, 0, s[[1]]], {n, 100}]
CROSSREFS
Cf. A062117 (order of 3 mod prime(n)).
Sequence in context: A184362 A354443 A011311 * A342315 A063890 A156439
KEYWORD
nonn
AUTHOR
T. D. Noe, Apr 14 2014
STATUS
approved