%I #57 Nov 01 2016 14:43:13
%S 1,2,4,76,418,1102,4687,7637,139183,2543923,1614895738,9083990938,
%T 23149317409,497240757797,4447730232523,16000967516764,65262766108619,
%U 141644055557882
%N Numbers n such that 3^n == 5 (mod n).
%C No other terms below 10^15. Some larger terms: 194995887252090239, 2185052151122686482926861593785262. - _Max Alekseyev_, Oct 13 2016
%e 3 == 5 (mod 1), so 1 is a term;
%e 9 == 5 (mod 2), so 2 is a term.
%t Select[Range[10^7], PowerMod[3, #, #] == Mod[5, #] &] (* _Michael De Vlieger_, Sep 26 2016 *)
%o (PARI) isok(n) = Mod(3, n)^n == Mod(5, n); \\ _Michel Marcus_, Sep 17 2016
%o (Python)
%o A276740_list = [1,2,4]+[n for n in range(5,10**6) if pow(3,n,n) == 5] # _Chai Wah Wu_, Oct 04 2016
%Y Cf. A066601.
%Y Solutions to 3^n == k (mod n): A277340 (k=-11), A277289 (k=-7), A277288 (k=-5), A015973 (k=-2), A015949 (k=-1), A067945 (k=1), A276671 (k=2), this sequence (k=5), A277628 (k=6), A277126 (k=7), A277630 (k=8), A277274 (k=11).
%K nonn,more
%O 1,2
%A _Dmitry Ezhov_, Sep 16 2016
%E a(11)-a(13) from _Chai Wah Wu_, Oct 05 2016
%E a(14) from _Lars Blomberg_, Oct 12 2016
%E a(15)-a(18) from _Max Alekseyev_, Oct 13 2016
%E a(12) was missing _Robert G. Wilson v_, Oct 19 2016