A097406 Largest primitive prime factor of 2^n-1, or a(n) = 1 if no such prime exists.
1, 3, 7, 5, 31, 1, 127, 17, 73, 11, 89, 13, 8191, 43, 151, 257, 131071, 19, 524287, 41, 337, 683, 178481, 241, 1801, 2731, 262657, 113, 2089, 331, 2147483647, 65537, 599479, 43691, 122921, 109, 616318177, 174763, 121369, 61681, 164511353, 5419
Offset: 1
Links
- Max Alekseyev, Table of n, a(n) for n = 1..1206
Programs
-
PARI
isprimitive(p, n) = {for (r=1, n-1, if (((2^r-1) % p) == 0, return (0));); return (1);} a(n) = {f = factor(2^n-1); forstep(i=#f~, 1, -1, if (isprimitive(f[i, 1], n), return (f[i, 1]));); return (1);} \\ Michel Marcus, Jul 15 2013
Formula
Extensions
More terms and better description from Vladeta Jovovic, Sep 03 2004
a(1) and a(6) changed from 0 to 1 by Jianing Song, Oct 23 2019
Comments