cython test.pyx doesn't actually run your program. The cython binary is for processing your Cython code into a Python extension module. You would have to import it in Python to run it.
#!/usr/bin/python isn't the best shebang line for Python scripts. #!/usr/bin/env python is generally preferred, which runs whatever python would on the command line.
- Cython
pyx files probably shouldn't have a shebang line at all, except in the corner case they are valid Python programs.
You have an IndentationError in the posted code.
Using the traditional interpreter is simpler and more portable. Cython is reliable, but has its limitations and quirks. It might be compelling to use it tons more if it magically gave the speedups your timings make it look like it does, but it actually gives smaller ones. You'll have to start using Cython-specific features to use C features to see a lot of speedup.