login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A240657
Least k such that 2^k == -1 (mod prime(n)), or 0 if no such k exists.
2
0, 1, 2, 0, 5, 6, 4, 9, 0, 14, 0, 18, 10, 7, 0, 26, 29, 30, 33, 0, 0, 0, 41, 0, 24, 50, 0, 53, 18, 14, 0, 65, 34, 69, 74, 0, 26, 81, 0, 86, 89, 90, 0, 48, 98, 0, 105, 0, 113, 38, 0, 0, 12, 25, 8, 0, 134, 0, 46, 35, 47, 146, 51, 0, 78, 158, 15, 0, 173, 174, 44, 0
OFFSET
1,3
COMMENTS
The least k, if it exists, such that prime(n) divides 2^k + 1.
FORMULA
a(n) = A014664(n)/2 if A014664(n) is even, otherwise 0.
MATHEMATICA
Table[p = Prime[n]; s = Select[Range[p/2], PowerMod[2, #, p] == p - 1 &, 1]; If[s == {}, 0, s[[1]]], {n, 100}]
CROSSREFS
Cf. A014664 (order of 2 mod prime(n)), A072936 (zero terms).
Sequence in context: A051111 A068558 A245058 * A262420 A240662 A188724
KEYWORD
nonn
AUTHOR
T. D. Noe, Apr 14 2014
STATUS
approved