A226221 Numbers n such that 2^n mod n is not a power of 2.
1, 2, 4, 8, 16, 18, 25, 27, 32, 35, 36, 42, 45, 49, 50, 54, 55, 64, 70, 75, 77, 81, 88, 91, 95, 98, 99, 100, 104, 105, 108, 110, 115, 117, 119, 121, 125, 128, 130, 135, 136, 140, 143, 147, 150, 152, 153, 155, 156, 160, 161, 162, 169, 171, 175, 180, 184, 187, 189, 190, 198, 200
Offset: 1
Keywords
Examples
2^18 = 262144 = 10 mod 18 and 10 is not a power of 2, so 18 is in the sequence.
Links
- Charles R Greathouse IV, Table of n, a(n) for n = 1..10000
Programs
-
Maple
isA226221 := proc(n) local m ; if n <= 2 then return true; end if; m := A015910(n) ; if type(m,'odd') or m = 0 then true; elif nops(numtheory[factorset](m)) >1 then true; else false; end if; end proc: A226221 := proc(n) local a; if n <= 2 then n; else for a from procname(n-1)+1 do if isA226221(a) then return a; end if; end do: end if; end proc: seq(A226221(n),n=1..30) ; # R. J. Mathar, Jun 06 2013
-
Mathematica
Select[Range[200],!IntegerQ[Log[2,PowerMod[2,#,#]]]&] (* Harvey P. Dale, Feb 28 2022 *)
-
PARI
ispow2(n)=n>0 && n==1<
Comments