OFFSET
1,2
COMMENTS
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..100
MAPLE
a:= proc(n) option remember; local k;
for k from 1+`if`(n=1, 0, a(n-1)) while
irem(k, 3)=0 or 2&^k mod k <> 8 mod k do od; k
end:
seq(a(n), n=1..30); # Alois P. Heinz, Jun 04 2014
MATHEMATICA
{1, 2, 4, 8} ~Join~ Select[Range[2 10^6], PowerMod[2, #, #] == 8 && !Divisible[#, 3]&] (* Jean-François Alcover, Nov 02 2020 *)
PROG
(PARI) isok(n) = (n % 3) && (Mod(2^n, n) == Mod(8, n)); \\ Michel Marcus, Oct 13 2013
CROSSREFS
KEYWORD
nonn
AUTHOR
Zak Seidov, May 12 2007
EXTENSIONS
a(17)-a(28) from Michel Marcus, Oct 13 2013
a(29)-a(36) from Alois P. Heinz, Jun 04 2014
STATUS
approved