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
KEYWORD
nonn
AUTHOR
J. M. Bergot and Charles R Greathouse IV, May 31 2013
STATUS
approved