%I #64 Nov 04 2023 06:23:10
%S 1,2,3,4,8,9,15,21,33,39,51,57,63,69,87,93,111,123,129,141,159,177,
%T 183,195,201,213,219,237,248,249,267,291,303,309,315,321,327,339,381,
%U 393,399,411,417,447,453,471,489,501,519,537,543,573,579,591,597,633
%N Numbers k such that 2^k == 8 (mod k).
%C For all m, 2^A015921(m) - 1 belongs to this sequence.
%H Michael De Vlieger, <a href="/A015922/b015922.txt">Table of n, a(n) for n = 1..29055</a> (first 6822 terms from Zak Seidov)
%H OEIS Wiki, <a href="/wiki/2^n mod n">2^n mod n</a>.
%t a015922Q[n_Integer] := If[Mod[2^n, n] == Mod[8, n], True, False];
%t a015922[n_Integer] :=
%t Flatten[Position[Thread[a015922Q[Range[n]]], True]];
%t a015922[1000000] (* _Michael De Vlieger_, Jul 16 2014 *)
%t m = 8; Join[Select[Range[m], Divisible[2^# - m, #] &], Select[Range[m + 1, 10^3], PowerMod[2, #, #] == m &]] (* _Robert Price_, Oct 12 2018 *)
%t Join[{1,2,3,4,8},Select[Range[650],PowerMod[2,#,#]==8&]] (* _Harvey P. Dale_, Aug 22 2020 *)
%o (PARI) isok(n) = Mod(2, n)^n == Mod(8, n); \\ _Michel Marcus_, Oct 13 2013, Jul 16 2014
%Y Contains A033553 as a subsequence.
%Y The odd terms form A276967.
%Y Cf. A015921, A130133, A130134.
%K nonn
%O 1,2
%A _Robert G. Wilson v_
%E First 5 terms inserted by _David W. Wilson_
|