Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #40 Apr 15 2020 12:12:05
%S 1,5,143,1133,2171,8567,16805,208091,1887043,517295383,878436591673
%N Positive integers n such that 7^n == 2 (mod n).
%C All terms are odd.
%C No other terms below 10^15. Some larger terms: 181204957971619289, 21305718571846184078167, 157*(7^157-2)/1355 (132 digits). - _Max Alekseyev_, Oct 18 2016
%F A066438(a(n)) = 2 for n > 1.
%e 7 == 2 mod 1, so 1 is a term;
%e 16807 == 2 mod 5, so 5 is a term.
%t Join[{1},Select[Range[5173*10^5],PowerMod[7,#,#]==2&]] (* The program will generate the first 10 terms of the sequence; it would take a very long time to generate the 11th term. *) (* _Harvey P. Dale_, Apr 15 2020 *)
%o (PARI) isok(n) = Mod(7, n)^n == 2; \\ _Michel Marcus_, Oct 13 2016
%Y Cf. A066438.
%Y Cf. Solutions to 7^n == k (mod n): A277371 (k=-3), A277370 (k=-2), A015954 (k=-1), A067947 (k=1), this sequence (k=2), A277554 (k=3).
%Y Cf. Solutions to b^n == 2 (mod n): A015919 (b=2), A276671 (b=3), A130421 (b=4), A124246 (b=5), this sequence (b=7), A116622 (b=13).
%K nonn,more
%O 1,2
%A _Seiichi Manyama_, Oct 13 2016
%E a(10) from _Michel Marcus_, Oct 13 2016
%E a(11) from _Max Alekseyev_, Oct 18 2016