Why the * after print? You're using print as a name, not calling it.
I think you want
for n from 3 by 2 to 99 do
if isprime(n) then print(n, ifactor((2^n+1)/3)) end if
end do;
EDIT: This problem can arise when using the default 2D input if you accidentally put a space after the "print".
$$ print(n, ifactor(2^n+1)/3)) $$ is ok, but
$$ print\; (n, ifactor(2^n+1)/3)) $$
is not. A space is interpreted here as an implied multiplication.
Unfortunately, it's hard to notice such spaces unless you look very carefully. One of the reasons I much prefer 1D Maple input to 2D input.