login

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

Least k such that 8^k == -1 (mod prime(n)), or 0 if no such k exists.
1

%I #4 Apr 15 2014 02:36:30

%S 0,1,2,0,5,2,4,3,0,14,0,6,10,7,0,26,29,10,11,0,0,0,41,0,8,50,0,53,6,

%T 14,0,65,34,23,74,0,26,27,0,86,89,30,0,16,98,0,35,0,113,38,0,0,4,25,8,

%U 0,134,0,46,35,47,146,17,0,26,158,5,0,173,58,44,0,0,62

%N Least k such that 8^k == -1 (mod prime(n)), or 0 if no such k exists.

%C The least k, if it exists, such that prime(n) divides 8^k + 1.

%H T. D. Noe, <a href="/A240663/b240663.txt">Table of n, a(n) for n = 1..1000</a>

%F a(n) = A211244(n)/2 if A211244(n) is even, otherwise 0.

%t Table[p = Prime[n]; s = Select[Range[p/2], PowerMod[8, #, p] == p - 1 &, 1]; If[s == {}, 0, s[[1]]], {n, 100}]

%Y Cf. A211244 (order of 8 mod prime(n)).

%K nonn

%O 1,3

%A _T. D. Noe_, Apr 14 2014