Ask Your Question

Revision history [back]

The "Solinas prime" wikipedia page says a Solinas prime is a prime of the form f(2^m) where f is a polynomial of low degree, and gives a few examples.

Hint: observe the structure of bits of each of these primes:

sage: l = [
....:         2^192 - 2^64 - 1,
....:         2^224 - 2^96 + 1,
....:         2^256 - 2^224 + 2^192 + 2^96 - 1,
....:         2^384 - 2^128 - 2^96 + 2^32 - 1,
....:         2^448 - 2^224 - 1
....:     ]
sage: for p in l:
....:     print(p.bits())

Then define a function to detect m and the polynomial from the bit structure.