login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A139023
Smallest prime factor of n! + 2^n - 1.
7
2, 5, 13, 3, 151, 3, 5167, 3, 7, 3, 39918847, 3, 17, 3, 7, 3, 829, 3, 25561, 3, 7, 3, 929, 3, 67, 3, 7, 3, 37, 3, 941, 3, 7, 3, 31, 3, 47, 3, 7, 3, 839, 3, 167, 3, 7, 3, 101, 3, 859, 3, 7, 3, 165437, 3, 23, 3, 7, 3, 199, 3, 526588200926847656291, 3, 7, 3, 31, 3, 157, 3, 7, 3
OFFSET
1,1
LINKS
Florian Luca and Igor E. Shparlinski, On the largest prime factor of n! + 2^n - 1, Journal de Theorie des Nombres de Bordeaux 17 (2005), 859-870.
MAPLE
# this code will produce FAIL for terms that can't be computed within a
# 30 second time limit
spf:= proc(n) local F;
F:= select(f -> f[1]::integer, ifactors(n, easy)[2]);
if F = [] then F:= traperror(timelimit(30, ifactors(n)[2])) fi;
if F = lasterror then FAIL else min(seq(f[1], f=F)) fi
end proc:
seq(spf(n!+2^n-1), n=1..100); # Robert Israel, Sep 18 2016
MATHEMATICA
a = {}; Do[AppendTo[a, n! + 2^n - 1], {n, 1, 40}]; b = {}; Do[c = FactorInteger[a[[n]]]; d = c[[1]]; AppendTo[b, d[[1]]], {n, 1, Length[a]}]; b
Table[FactorInteger[n! + 2^n - 1] [[1, 1]], {n, 1, 40}] (* Vincenzo Librandi, Sep 18 2016 *)
PROG
(Magma) trialdiv:=function(n, P) val:=0; for p in P do if n mod p eq 0 then val:=p; break; end if; end for; return val; end function; P:=PrimesUpTo(300000000); [ trialdiv(a, P) where a is Factorial(n)+2^n-1: n in [1..70] ]; //a(61) requires a separate computation. // Klaus Brockhaus, Nov 06 2009
(PARI) a(n)=factor(n!+2^n-1)[1, 1] \\ Charles R Greathouse IV, Feb 01 2013
CROSSREFS
KEYWORD
nonn
AUTHOR
Artur Jasinski, Apr 06 2008, corrected Apr 22 2008
EXTENSIONS
a(1) - a(40) verified and a(41) - a(70) added by Klaus Brockhaus, Nov 06 2009
STATUS
approved