login
A226221
Numbers n such that 2^n mod n is not a power of 2.
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,2
COMMENTS
All terms beyond the first two are composite: this is a subsequence of A065090.
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 1..10000
EXAMPLE
2^18 = 262144 = 10 mod 18 and 10 is not a power of 2, so 18 is in the sequence.
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 *)
PROG
(PARI) ispow2(n)=n>0 && n==1<<valuation(n, 2)
is(n)=!ispow2(lift(Mod(2, n)^n))
CROSSREFS
Sequence in context: A127066 A331382 A154362 * A072462 A369951 A088827
KEYWORD
nonn
AUTHOR
STATUS
approved