Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #48 Jan 16 2023 19:47:02
%S 1,2,3,4,20,260,740,2132,2180,5252,43364,49268,49737,80660,130052,
%T 293620,542852,661412,717027,865460,1564180,2185220,2192132,2816372,
%U 3784916,4377620,4427540,5722004,6307652,6919460,8765252,9084452,9498260,9723611,11346260,12208820,12220132
%N Numbers k that divide 2^k + 4.
%H Jens Kruse Andersen, <a href="/A244673/b244673.txt">Table of n, a(n) for n = 1..100</a>
%H OEIS Wiki, <a href="/wiki/2^n mod n">2^n mod n</a>
%e 2^2 + 4 = 8 is divisible by 2. Thus 2 is a term of this sequence.
%e 2^3 + 4 = 12 is divisible by 3. Thus 3 is a term of this sequence.
%e 2^4 + 4 = 20 is divisible by 4. Thus 4 is a term of this sequence.
%p A244673:=n->`if`(type((2^n+4)/n, integer), n, NULL): seq(A244673(n), n=1..10^5); # _Wesley Ivan Hurt_, Jul 15 2014
%p Alternative:
%p select(n -> 4 + 2&^n mod n = 0, [$1..10^5]); # _Robert Israel_, Jul 15 2014
%t Select[Range[1000], Mod[2^# + 4, #] == 0 &] (* _Alonso del Arte_, Jul 14 2014 *)
%t Join[{1,2,3},Select[Range[1223*10^4],PowerMod[2,#,#]==#-4&]] (* _Harvey P. Dale_, Jan 16 2023 *)
%o (PARI) for(n=1, 10^8, if(Mod(2,n)^n+4==0, print1(n, ", "))) \\ _Jens Kruse Andersen_, Jul 15 2014
%Y The odd terms form A115976.
%Y Cf. A015921, A140504.
%K nonn
%O 1,2
%A _Derek Orr_, Jul 14 2014