cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-10 of 12 results. Next

A160245 a(n) = index of the n-th prime in A051301 (least prime factor of m!+1).

Original entry on oeis.org

2, 1, 1, 2, 2, 1, 1, 2, 2, 1, 1, 1, 1, 2, 2, 1, 3, 2, 2, 6, 1, 3, 3, 1, 1, 1, 1, 1, 2, 1, 1, 2, 3, 1, 2, 1, 1, 2, 1, 1, 2, 1, 2, 1, 1, 2, 1, 1, 4, 1, 2, 1, 1, 3, 3, 2, 2, 3, 1, 1, 1, 5, 3, 2, 1, 2, 1, 1, 2, 1, 1, 2, 2, 1, 2, 4, 2, 2, 5, 1, 2, 1, 2, 1, 1, 2, 2, 1, 2, 3, 3, 3, 1, 2, 1, 3, 1, 1, 2, 1, 1, 2, 4, 2, 4
Offset: 1

Views

Author

Frederick Magata (frederick.magata(AT)web.de), May 05 2009

Keywords

Comments

Because of Wilson's theorem A051301(p-1)=p for every prime p. Hence a(n)>0, and since A051301(k)>k, a(n) is actually finite.
The first 18 values of the sequence were calculated with Maple. The others were derived from T. D. Noe's b-file for b051301.txt.

Examples

			a(17)=3 because A051301(15)=A051301(43)=A051301(58)=59, and there are no other occurrences of 59=17th prime number in A051301.
		

Crossrefs

Programs

  • Maple
    a:=proc(n) option remember; local k,l,p: p:=ithprime(n): l:=0: for k from 0 to p-2 do if A051301(k)=p then l:=l+1; fi; od; l+1; end;
  • Mathematica
    prev={}; Table[p=Prime[n]; s=Select[Complement[Range[0,p-1],prev], Mod[ #!+1,p]==0&]; prev=Union[s,prev]; Length[s], {n,100}] (* T. D. Noe, May 12 2009 *)

Extensions

Extended by T. D. Noe, May 12 2009

A038507 a(n) = n! + 1.

Original entry on oeis.org

2, 2, 3, 7, 25, 121, 721, 5041, 40321, 362881, 3628801, 39916801, 479001601, 6227020801, 87178291201, 1307674368001, 20922789888001, 355687428096001, 6402373705728001, 121645100408832001, 2432902008176640001, 51090942171709440001, 1124000727777607680001, 25852016738884976640001
Offset: 0

Views

Author

Keywords

Comments

"For n = 4, 5 and 7, n!+1 is a square. Sierpiński asked if there are any other values of n with this property." p. 82 of Ogilvy and Anderson (see A146968).
Number of {12,12*,1*2,21*,2*1}-avoiding signed permutations in the hyperoctahedral group.
After Wilson's Theorem: if (n+1) is prime then (n+1) is the smallest prime factor of a(n). - Karl-Heinz Hofmann, Aug 21 2024

Examples

			G.f. = 2 + 2*x + 3*x^2 + 7*x^3 + 25*x^4 + 121*x^5 + 721*x^6 + 5041*x^7 + ...
		

References

  • C. Stanley Ogilvy and John T. Anderson, Excursions in Number Theory, Oxford University Press, 1966, p. 82.
  • Wacław Sierpiński, On some unsolved problems of arithmetics, Scripta Mathematica, vol. 25 (1960), p. 125.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).

Crossrefs

Programs

Formula

a(n) = n * (a(n-1) - 1) + 1. - Reinhard Zumkeller, Mar 20 2013
0 = a(n)*(a(n+1) - 5*a(n+2) + 5*a(n+3) - a(n+4)) + a(n+1)*(a(n+1) + a(n+2) - 6*a(n+3) + 2*a(n+4)) + a(n+2)*(3*a(n+2) - a(n+3) - a(n+4)) + a(n+3)*(a(n+3)) if n>=0. - Michael Somos, Apr 23 2014
From Ilya Gutkovskiy, Jan 20 2017: (Start)
E.g.f: exp(x) + 1/(1 - x).
Sum_{n>=0} 1/a(n) = A217702. (End)

Extensions

Additional comments from Jason Earls, Apr 01 2001
Numericana.com URL fixed by Gerard P. Michon, Mar 30 2010
Entry revised by N. J. A. Sloane, Jun 10 2012

A002583 Largest prime factor of n! + 1.

Original entry on oeis.org

2, 2, 3, 7, 5, 11, 103, 71, 661, 269, 329891, 39916801, 2834329, 75024347, 3790360487, 46271341, 1059511, 1000357, 123610951, 1713311273363831, 117876683047, 2703875815783, 93799610095769647, 148139754736864591, 765041185860961084291, 38681321803817920159601
Offset: 0

Views

Author

Keywords

Comments

Theorem: For any N, there is a prime > N. Proof: Consider any prime factor of N!+1.
Cf. Wilson's theorem (1770): p | (p-1)! + 1 iff p is a prime.
If n is in A002981, then a(n) = n!+1. - Chai Wah Wu, Jul 15 2019

Examples

			(0!+1)=[2], (1!+1)=[2], (2!+1)=[3], (3!+1)=[7], (4!+1)=25=5*[5], (5!+1)=121=11*[11], (6!+1)=721=7*[103], (7!+1)=5041=71*[71], etc. - Mitch Cervinka (puritan(AT)toast.net), May 11 2009
		

References

  • M. Kraitchik, On the divisibility of factorials, Scripta Math., 14 (1948), 24-26 (but beware errors).
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Magma
    [Maximum(PrimeDivisors(Factorial(n)+1)): n in [0..30]]; // Vincenzo Librandi, Feb 14 2020
  • Mathematica
    PrimeFactors[n_]:=Flatten[Table[ #[[1]],{1}]&/@FactorInteger[n]]; Table[PrimeFactors[n!+1][[ -1]],{n,0,35}] ..and/or.. Table[FactorInteger[n!+1,FactorComplete->True][[ -1,1]],{n,0,35}] (* Vladimir Joseph Stephan Orlovsky, Aug 12 2009 *)
    FactorInteger[#][[-1,1]]&/@(Range[0,30]!+1) (* Harvey P. Dale, Sep 04 2017 *)
  • PARI
    a(n)=my(f=factor(n!+1)[,1]);f[#f] \\ Charles R Greathouse IV, Dec 05 2012
    

Formula

Erdős & Stewart show that a(n) > n + (1-o(1))log n/log log n and lim sup a(n)/n > 2. - Charles R Greathouse IV, Dec 05 2012
Lai proves that lim sup a(n)/n > 7.238. - Charles R Greathouse IV, Jun 22 2021

Extensions

More terms from Robert G. Wilson v, Aug 01 2000
Corrected by Jud McCranie, Jan 03 2001

A104366 Smallest prime factor of A104365(n) = A104350(n) + 1.

Original entry on oeis.org

2, 3, 7, 13, 61, 181, 13, 2521, 7561, 103, 415801, 1247401, 167, 191, 211, 127, 23, 40357, 1099944846001, 349, 41, 251, 37, 2243, 146100174169950001, 103, 53, 1217, 1156675078903494150001, 47, 2939, 251, 857, 41, 547, 13127, 47, 48563, 281, 1336484560722851, 479, 373, 2179, 577670972464621571, 17491, 1399, 97, 22893547
Offset: 1

Views

Author

Reinhard Zumkeller, Mar 06 2005

Keywords

Comments

a(n) = A020639(A104365(n)).

Crossrefs

Programs

  • PARI
    gpf(n) = if (n==1, 1, vecmax(factor(n)[,1])); \\ A006530
    spf(n) = if (n==1, 1, vecmin(factor(n)[,1])); \\ A020639
    a(n) = spf(prod(i=2, n, gpf(i))+1); \\ Michel Marcus, Feb 21 2023

Extensions

Corrected by D. S. McNeil, Dec 10 2010

A054415 Smallest prime factor of n!-1 (for n>2), a(2)=1.

Original entry on oeis.org

1, 5, 23, 7, 719, 5039, 23, 11, 29, 13, 479001599, 1733, 87178291199, 17, 3041, 19, 59, 653, 124769, 23, 109, 51871, 625793187653, 149, 20431, 29, 239, 31, 265252859812191058636308479999999, 787, 263130836933693530167218012159999999, 8683317618811886495518194401279999999
Offset: 2

Views

Author

Henry Bottomley, May 10 2000

Keywords

Comments

The initial term a(2)=1 is not a prime, but it does not affect search results and may prevent submission of duplicates. - M. F. Hasler, Oct 31 2012

Examples

			a(3)=5 because 3!-1=5 which is prime; a(5)=7 because 5!-1=119=7*17 and 7<17
		

Crossrefs

Programs

  • Mathematica
    Do[ Print[ FactorInteger[ n! - 1, FactorComplete -> True][ [1, 1] ] ], {n, 3, 32} ]
  • PARI
    A054415(n)=if(n>2,factor(n!-1)[1,1],1)  \\ M. F. Hasler, Oct 31 2012

Formula

Erdős & Stewart show that a(n) > n + (l-o(l))log n/log log n except when n+1 is prime, and that a(n) > n + e(n)sqrt(n) for almost all n where e(n) is any function with lim e(n) = 0. - Charles R Greathouse IV, Dec 05 2012

Extensions

More terms from Robert G. Wilson v, Aug 01 2000
More terms from Amiram Eldar, Oct 07 2019

A056111 Highest proper factor of n!+1.

Original entry on oeis.org

1, 1, 1, 1, 5, 11, 103, 71, 661, 19099, 329891, 1, 36846277, 75024347, 3790360487, 22163972339, 1230752346353, 538105034941, 336967037143579, 1713311273363831, 117876683047, 1188161445853707907, 48869596859895986087, 550042909337978226383, 765041185860961084291
Offset: 0

Views

Author

Henry Bottomley, Jun 12 2000

Keywords

Crossrefs

Programs

  • Mathematica
    a[n_] := Divisors[n!+1][[ -2]]

Formula

a(n) = A038507(n)/A051301(n).

Extensions

Corrected and extended by Dean Hickerson, Aug 30 2001
More terms from Amiram Eldar, Oct 07 2019

A051454 a(n) is the smallest prime factor of 1 + lcm(1..k) where k is the n-th prime power A000961(n).

Original entry on oeis.org

2, 3, 7, 13, 61, 421, 29, 2521, 19, 89, 71, 1693, 232792561, 6659, 26771144401, 331, 101, 72201776446801, 1801, 173, 54941, 89, 442720643463713815201, 593, 5171, 239, 1222615931, 103, 7265496855919, 6562349363, 4447, 147099357127, 1931
Offset: 1

Views

Author

Keywords

Examples

			1 + lcm(1..8) = 29^2, so its smallest prime divisor is 29; it occurs as the 7th term in the sequence because 8 is the 7th prime power: A000961(7) = 8.
		

Crossrefs

Programs

  • Magma
    a:=[]; lcm:=1; for k in [1..83] do if (k eq 1) or IsPrimePower(k) then lcm:=Lcm(lcm,k); a:=a cat [Factorization(1+lcm)[1][1]]; end if; end for; a; // Jon E. Schoenfield, May 28 2018
    
  • Mathematica
    Join[{2},With[{ppwr=Select[Range[200],PrimePowerQ]},Table[FactorInteger[LCM@@Take[ ppwr,n]+ 1][[1,1]],{n,40}]]] (* Harvey P. Dale, May 28 2024 *)
  • PARI
    a(n) = {my(nb = 1, lc = 1, k = 2); while (nb != n, if (isprimepower(k), nb++; lc = lcm(lc, k)); k++;); vecmin(factor(lc +1)[,1]);} \\ Michel Marcus, May 29 2018
    
  • Python
    from math import prod
    from sympy import primepi, integer_nthroot, integer_log, primerange, primefactors
    def A051454(n):
        def f(x): return int(n+x-1-sum(primepi(integer_nthroot(x,k)[0]) for k in range(1,x.bit_length())))
        m, k = n, f(n)
        while m != k:
            m, k = k, f(k)
        return min(primefactors(1+prod(p**integer_log(m, p)[0] for p in primerange(m+1)))) # Chai Wah Wu, Aug 15 2024

A096225 a(0) = 1; for n >= 0, a(n+1) = smallest prime factor of a(n)! + 1.

Original entry on oeis.org

1, 2, 3, 7, 71, 6653, 25469, 15750503
Offset: 0

Views

Author

N. J. A. Sloane, Aug 09 2004

Keywords

Examples

			71!+1 is the product of 6653 and a large prime.
		

Crossrefs

Programs

  • Mathematica
    a[1] = 2; a[n_] := Block[{p = PrimePi[a[n - 1]] + 1, r = a[n - 1]! + 1}, While[ Mod[r, Prime[p]] != 0, p++ ]; Prime[p]]; Do[ Print[ a[n]], {n, 7}] (* Robert G. Wilson v, Aug 12 2004 *)
    NestList[FactorInteger[#!+1][[1,1]]&,1,7] (* Harvey P. Dale, Sep 20 2016 *)

Extensions

a(6) and a(7) from Robert G. Wilson v, Aug 12 2004

A362778 Triangular array read by rows: T(n,k) is the least prime factor of n!*k + 1, n >= 1, 1 <= k <= n.

Original entry on oeis.org

2, 3, 5, 7, 13, 19, 5, 7, 73, 97, 11, 241, 19, 13, 601, 7, 11, 2161, 43, 13, 29, 71, 17, 15121, 20161, 11, 30241, 35281, 61, 11, 73, 161281, 449, 241921, 282241, 47, 19, 293, 1088641, 1451521, 23, 2177281, 13, 2903041, 17, 11, 13, 10886401, 233, 18144001, 17, 101, 29030401, 32659201, 43
Offset: 1

Views

Author

Joe B. Stephen, May 03 2023

Keywords

Comments

The primes in each row are distinct because n!*k + 1 are coprime for 1 <= k <= n, and hence this array gives a simple proof that there are infinitely many prime numbers.

Examples

			Triangle T(n,k) begins:
  n\k  1    2    3    4    5    6 ...
  1    2
  2    3    5
  3    7   13   19
  4    5    7   73   97
  5   11  241   19   13  601
  6    7   11 2161   43   13   29
  ...
		

Crossrefs

Cf. A051301 (1st column).

Formula

T(n,k) = A020639(A362777(n,k)).

A166862 Primes p that divide n! + 1 for some n other than p-1.

Original entry on oeis.org

2, 7, 11, 19, 23, 29, 43, 47, 59, 61, 67, 71, 79, 83, 103, 109, 127, 131, 137, 139, 149, 163, 179, 191, 193, 199, 227, 233, 239, 251, 257, 263, 269, 271, 277, 293, 307, 311, 317, 347, 359, 367, 379, 383, 389, 397, 401, 419, 431, 443, 449, 461, 463, 467, 479
Offset: 1

Views

Author

Michael B. Porter, Oct 22 2009

Keywords

Comments

For n >= p, p is one of the factors of n!, so p cannot divide n! + 1. As a result, only 0 <= n <= p-2 needs to be searched.
For n = p-1, by Wilson's Theorem, (p-1)! = -1 (mod p), so p divides (p-1)! + 1.
Since by convention 0! = 1, 2 is included in the sequence as dividing 0!+1 = 2.
The standard heuristic suggests that the fraction of primes in this sequence is 1 - 1/e or about 63%. - Charles R Greathouse IV, Apr 17 2013

Examples

			11 is included in the sequence since 11 divides 5! + 1 = 121.
13 is not included in the sequence since the only n for which 13 divides n! + 1 is n = 12.
		

Crossrefs

Programs

  • PARI
    isA166862(n) = {local(r);r=0;for(i=0,n-2,if((i!+1)%n==0,r=1));r}
    
  • PARI
    is(p)=my(m=Mod(1,p)); for(k=2,p-2,m*=k; if(m==-1, return(isprime(p)))); p==2 \\ Charles R Greathouse IV, Apr 17 2013
Showing 1-10 of 12 results. Next