OFFSET
1,2
LINKS
Jens Kruse Andersen, Table of n, a(n) for n = 1..100
OEIS Wiki, 2^n mod n
EXAMPLE
2^2 + 4 = 8 is divisible by 2. Thus 2 is a term of this sequence.
2^3 + 4 = 12 is divisible by 3. Thus 3 is a term of this sequence.
2^4 + 4 = 20 is divisible by 4. Thus 4 is a term of this sequence.
MAPLE
A244673:=n->`if`(type((2^n+4)/n, integer), n, NULL): seq(A244673(n), n=1..10^5); # Wesley Ivan Hurt, Jul 15 2014
Alternative:
select(n -> 4 + 2&^n mod n = 0, [$1..10^5]); # Robert Israel, Jul 15 2014
MATHEMATICA
Select[Range[1000], Mod[2^# + 4, #] == 0 &] (* Alonso del Arte, Jul 14 2014 *)
Join[{1, 2, 3}, Select[Range[1223*10^4], PowerMod[2, #, #]==#-4&]] (* Harvey P. Dale, Jan 16 2023 *)
PROG
(PARI) for(n=1, 10^8, if(Mod(2, n)^n+4==0, print1(n, ", "))) \\ Jens Kruse Andersen, Jul 15 2014
CROSSREFS
KEYWORD
nonn
AUTHOR
Derek Orr, Jul 14 2014
STATUS
approved