OFFSET
2,2
COMMENTS
The smallest prime factor of 2^n-1 of the form k*n+1 is A186522(n).
By Fermat's little theorem, a(n) = 1 if and only if n+1 is an odd prime. Further, for prime p, a(p) = 2 if and only if p is in A002515. - Thomas Ordowski, Sep 03 2017
REFERENCES
Kenneth H. Rosen, Elementary Number Theory and Its Applications, 3rd Ed, Theorem 6.12, p. 225
LINKS
Max Alekseyev, Table of n, a(n) for n = 2..1236 (terms to a(300) from David A. Corneth)
Will Edgington, Mersenne Page [from Internet Archive Wayback Machine]
Eric W. Weisstein, MathWorld: Mersenne Number
Eric W. Weisstein, MathWorld: Mersenne Prime
FORMULA
a(n) = (A186522(n)-1)/n.
EXAMPLE
For n=8, 2^n-1 = 255 = 3 * 5 * 17. The smallest prime factor of the form k*n+1 is 17 = 2*8+1. Hence, a(8) = 2.
MATHEMATICA
Table[p=First/@FactorInteger[2^n-1]; (Select[p, Mod[#1, n] == 1 &, 1][[1]] - 1)/n, {n, 2, 70}]
PROG
(PARI) a(n) = {if(isprime(n+1), return(1)); my(f = factor(2^n - 1)[, 1]); for(i=1, #f, if(f[i]%n == 1, return((f[i]-1) / n)))} \\ David A. Corneth, Sep 03 2017
CROSSREFS
KEYWORD
nonn
AUTHOR
Bill McEachen, Feb 16 2011
STATUS
approved