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

A033312 a(n) = n! - 1.

Original entry on oeis.org

0, 0, 1, 5, 23, 119, 719, 5039, 40319, 362879, 3628799, 39916799, 479001599, 6227020799, 87178291199, 1307674367999, 20922789887999, 355687428095999, 6402373705727999, 121645100408831999, 2432902008176639999, 51090942171709439999, 1124000727777607679999
Offset: 0

Views

Author

N. J. A. Sloane. This sequence appeared in the 1973 "Handbook", but was then dropped from the database. Resubmitted by Eric W. Weisstein. Entry revised by N. J. A. Sloane, Jun 12 2012

Keywords

Comments

a(n) gives the index number in any table of permutations of the entry in which the last n + 1 items are reversed. - Eugene McDonnell (eemcd(AT)mac.com), Dec 03 2004
a(n), n >= 1, has the factorial representation [n - 1, n - 2, ..., 1, 0]. The (unique) factorial representation of a number m from {0, 1, ... n! - 1} is m = sum(m_j(n)*j!, j = 0 .. n - 1) with m_j(n) from {0, 1, .., j}, n>=1. This is encoded as [m_{n-1},m_{n-2},...,m+1,m_0] with m_0=0. This can be interpreted as (D. N.) Lehmer code for the lexicographic rank of permutations of the symmetric group S_n (see the W. Lang link under A136663). The Lehmer code [n - 1, n - 2, ..., 1, 0] stands for the permutation [n, n - 1, ..., 1] (the last in lexicographic order). - Wolfdieter Lang, May 21 2008
For n >= 3: a(n) = numbers m for which there is one iteration {floor (r / k)} for k = n, n - 1, n - 2, ... 2 with property r mod k = k - 1 starting at r = m. For n = 5: a(5) = 119; floor (119 / 5) = 23, 119 mod 5 = 4; floor (23 / 4) = 5, 23 mod 4 = 3; floor (5 / 3) = 1, 5 mod 3 = 2; floor (1 / 2) = 0; 1 mod 2 = 1. - Jaroslav Krizek, Jan 23 2010
For n = 4, define the sum of all possible products of 1, 2, 3, 4 to be 1 + 2 + 3 + 4 add 1*2 + 1*3 + 1*4 add 2*3 + 2*4 + 3*4 add 1*2*3 + 1*2*4 + 1*3*4 + 2*3*4 add 1*2*3*4. The sum of this is 119 = (4 + 1)! - 1. For n = 5 I get the sum 719 = (5 + 1)! - 1. The proof for the general case seems to follow by induction. - J. M. Bergot, Jan 10 2011

Examples

			G.f. = x^2 + 5*x^3 + 23*x^4 + 119*x^5 + 719*x^6 + 5039*x^7 + 40319*x^8 + ...
		

References

  • Arthur T. Benjamin and Jennifer J. Quinn, Proofs that really count: the art of combinatorial proof, M.A.A. 2003, identity 181, p. 92.
  • Michael Doob, The Canadian Mathematical Olympiad & L'Olympiade Mathématique du Canada 1969-1993, Canadian Mathematical Society & Société Mathématique du Canada, Problem 6, 1969, p. 3, 1993.
  • Problem 598, J. Rec. Math., 11 (1978), 68-69.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).

Crossrefs

Cf. A000142, A001563 (first differences), A002582, A002982, A038507 (factorizations), A054415, A056110, A331373.
Row sums of A008291.

Programs

Formula

a(n) = Sum_{k = 1 .. n} (k-1)*(k-1)!.
a(n) = a(n - 1)*(n - 1) + a(n - 1) + n - 1, a(0) = 0. - Reinhard Zumkeller, Feb 03 2003
a(0) = a(1) = 0, a(n) = a(n - 1) * n + (n - 1) for n >= 2. - Jaroslav Krizek, Jan 23 2010
E.g.f.: 1/(1 - x) - exp(x). - Sergei N. Gladkovskii, Jun 29 2012
0 = 1 + a(n)*(+a(n+1) - a(n+2)) + a(n+1)*(+3 + a(n+1)) + a(n+2)*(-1) for n>=0. - Michael Somos, Feb 24 2017
Sum_{n>=2} 1/a(n) = A331373. - Amiram Eldar, Nov 11 2020

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

A051301 Smallest prime factor of n!+1.

Original entry on oeis.org

2, 2, 3, 7, 5, 11, 7, 71, 61, 19, 11, 39916801, 13, 83, 23, 59, 17, 661, 19, 71, 20639383, 43, 23, 47, 811, 401, 1697, 10888869450418352160768000001, 29, 14557, 31, 257, 2281, 67, 67411, 137, 37, 13763753091226345046315979581580902400000001
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 if and only if p is a prime.
If n is in A002981, then a(n) = n!+1. - Chai Wah Wu, Jul 15 2019

Examples

			a(3) = 7 because 3! + 1 = 7.
a(4) = 5 because 4! + 1 = 25 = 5^2. (5! + 1 is also the square of a prime).
a(6) = 7 because 6! + 1 = 721 = 7 * 103.
		

References

  • Albert H. Beiler, "Recreations in The Theory of Numbers, The Queen of Mathematics Entertains," Dover Publ. NY, 1966, Page 49.
  • M. Kraitchik, On the divisibility of factorials, Scripta Math., 14 (1948), 24-26 (but beware errors).

Crossrefs

Programs

  • Maple
    with(numtheory): A051301 := n -> sort(convert(divisors(n!+1),list))[2]; # Corrected by Peter Luschny, Jul 17 2009
  • Mathematica
    Do[ Print[ FactorInteger[ n! + 1, FactorComplete -> True ] [ [ 1, 1 ] ] ], {n, 0, 38} ]
    FactorInteger[#][[1,1]]&/@(Range[0,40]!+1) (* Harvey P. Dale, Oct 16 2021 *)
  • PARI
    a(n)=factor(n!+1)[1,1] \\ Charles R Greathouse IV, Dec 05 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
By Wilson's theorem, a(n) >= n + 1 with equality if and only if n + 1 is prime. - Chai Wah Wu, Jul 14 2019

A002585 Largest prime factor of 1 + (product of first n primes).

Original entry on oeis.org

3, 7, 31, 211, 2311, 509, 277, 27953, 703763, 34231, 200560490131, 676421, 11072701, 78339888213593, 13808181181, 18564761860301, 19026377261, 525956867082542470777, 143581524529603, 2892214489673, 16156160491570418147806951, 96888414202798247, 1004988035964897329167431269
Offset: 1

Views

Author

Keywords

Comments

Based on Euclid's proof that there are infinitely many primes.
The products of the first primes are called primorial numbers. - Franklin T. Adams-Watters, Jun 12 2014

References

  • M. Kraitchik, On the divisibility of factorials, Scripta Math., 14 (1948), 24-26 (but beware errors).
  • M. Kraitchik, Introduction à la Théorie des Nombres. Gauthier-Villars, Paris, 1952, p. 2.
  • 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

  • Mathematica
    FactorInteger[#][[-1,1]]&/@Rest[FoldList[Times,1,Prime[Range[30]]]+1] (* Harvey P. Dale, Apr 10 2012 *)
  • PARI
    a(n)=my(f=factor(prod(i=1,n,prime(i))+1)[,1]); f[#f] \\ Charles R Greathouse IV, Feb 07 2017

Formula

a(n) = A006530(A006862(n)). - Amiram Eldar, Feb 13 2020

Extensions

More terms from Labos Elemer, May 02 2000
More terms from Robert G. Wilson v, Mar 24 2001
Terms up to a(81) in b-file added by Sean A. Irvine, Apr 19 2014
Terms a(82)-a(87) in b-file added by Amiram Eldar, Feb 13 2020
Terms a(88)-a(98) in b-file added by Max Alekseyev, Aug 26 2021

A051342 Smallest prime factor of 1 + (product of first n primes).

Original entry on oeis.org

3, 7, 31, 211, 2311, 59, 19, 347, 317, 331, 200560490131, 181, 61, 167, 953, 73, 277, 223, 54730729297, 1063, 2521, 22093, 265739, 131, 2336993, 960703, 2297, 149, 334507, 5122427, 1543, 1951, 881, 678279959005528882498681487, 87549524399, 23269086799180847
Offset: 1

Views

Author

Keywords

Comments

Based on Euclid's proof that there are infinitely many primes.

Crossrefs

Programs

  • Maple
    a:= proc(n)
    local N, F, i;
      N:= 1 + mul(ithprime(i),i=1..n);
      F:= select(type,map(t->t[1],ifactors(N,easy)[2]),integer);
    if nops(F) >= 1 then return min(F) fi;
      min(map(t->t[1],ifactors(N)[2]))
    end proc:
    seq(a(n),n=1..40); # Robert Israel, Oct 19 2014
  • Mathematica
    Map[FactorInteger,
       Table[Product[Prime[n], {n, 1, m}] + 1, {m, 1, 36}]][[All,
    1]][[All, 1]] (* Geoffrey Critzer, Oct 19 2014 *)
    FactorInteger[#][[1,1]]&/@(FoldList[Times,Prime[Range[40]]]+1) (* Harvey P. Dale, Oct 08 2021 *)
  • PARI
    a(n) = factor(1 + prod(i=1, n, prime(i)))[1, 1]; \\ Michel Marcus, Dec 10 2013

Formula

a(n) = A020639(1+A002110(n)).

Extensions

One more term from Michel Marcus, Dec 10 2013

A104359 Greatest prime factor of A104357(n) = A104350(n) - 1.

Original entry on oeis.org

1, 5, 11, 59, 179, 1259, 229, 7559, 37799, 415799, 17569, 71437, 18979, 62597, 1135133999, 1646947, 445771, 277021, 5499724229999, 2217247573, 721381, 46313123, 29220034833989999, 16347569521, 5464930609, 4939567, 319699160368361, 2605998587146349, 178974179, 15701603, 116318025830291273, 126202964557
Offset: 2

Views

Author

Reinhard Zumkeller, Mar 06 2005

Keywords

Crossrefs

Programs

  • Mathematica
    a[n_] := FactorInteger[-1 + Product[FactorInteger[k][[-1, 1]], {k, 1, n}]][[-1, 1]]; Array[a, 50, 2] (* Amiram Eldar, Feb 12 2020 *)
  • PARI
    gpf(n) = if (n==1, 1, vecmax(factor(n)[,1])); \\ A006530
    a(n) = gpf(prod(i=2, n, gpf(i))-1); \\ Michel Marcus, Feb 21 2023

Formula

a(n) = A006530(A104357(n)).

A002584 Largest prime factor of product of first n primes - 1, or 1 if no such prime exists.

Original entry on oeis.org

1, 5, 29, 19, 2309, 30029, 8369, 929, 46027, 81894851, 876817, 38669, 304250263527209, 92608862041, 59799107, 1143707681, 69664915493, 1146665184811, 17975352936245519, 2140320249725509
Offset: 1

Views

Author

Keywords

Comments

The products of the first primes are called primorial numbers. - Franklin T. Adams-Watters, Jun 12 2014

References

  • M. Kraitchik, On the divisibility of factorials, Scripta Math., 14 (1948), 24-26 (but beware errors).
  • M. Kraitchik, Introduction à la Théorie des Nombres. Gauthier-Villars, Paris, 1952, p. 2.
  • 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

  • Mathematica
    Prepend[Table[ Max[Transpose[FactorInteger[(Times @@ Prime[Range[i]]) - 1]][[1]]], {i, 2, 20}], 1]
    FactorInteger[#][[-1,1]]&/@Rest[FoldList[Times,1,Prime[Range[20]]]-1] (* Harvey P. Dale, Feb 27 2013 *)
  • PARI
    a(n)=if(n>1, my(f=factor(prod(i=1,f,prime(i)))[,1]); f[#f], 1) \\ Charles R Greathouse IV, Feb 08 2017

Formula

a(n) = A006530(A057588(n)). - Amiram Eldar, Feb 13 2020

Extensions

More terms from J. L. Selfridge
Further terms from Labos Elemer, Oct 25 2000

A064145 a(n) = tau(n!-1) or number of divisors of n!-1.

Original entry on oeis.org

1, 2, 2, 4, 2, 2, 4, 6, 4, 16, 2, 4, 2, 24, 4, 8, 8, 8, 4, 16, 8, 4, 4, 8, 4, 4, 16, 32, 2, 8, 2, 2, 4, 8, 4, 32, 2, 16, 4, 16, 16, 128, 16, 32, 32, 4, 16, 8, 4, 32, 32, 16, 64, 64, 32, 64, 32, 4, 8, 16, 16, 32, 16, 64, 16, 128, 4, 64, 32, 32, 8, 16, 32, 128, 8
Offset: 2

Views

Author

Vladeta Jovovic, Sep 11 2001

Keywords

Crossrefs

Programs

  • Mathematica
    Do[ Print[ DivisorSigma[0, n! - 1]], {n, 2, 40} ]
    DivisorSigma[0,Range[2,80]!-1] (* Harvey P. Dale, Aug 17 2024 *)
  • PARI
    { f=1; for (n=2, 100, f*=n; if (n>1, a=numdiv(f - 1), a=0); write("b064145.txt", n, " ", a) ) } \\ Harry J. Smith, Sep 09 2009

Extensions

More terms from Robert G. Wilson v, Oct 04 2001
a(51)-a(76) from Harry J. Smith, Sep 09 2009
Ambiguous term a(1) removed by Max Alekseyev, May 06 2022

A057713 Smallest prime divisor of Kummer numbers ( = primorials - 1), or 1 if no such prime exists.

Original entry on oeis.org

1, 5, 29, 11, 2309, 30029, 61, 53, 37, 79, 228737, 229, 304250263527209, 141269, 191, 87337, 27600124633, 1193, 163, 260681003321, 313, 163, 139, 23768741896345550770650537601358309, 66683, 2990092035859, 15649, 17515703, 719, 295201, 15098753, 10172884549, 20962699238647, 4871, 673, 311, 1409, 1291, 331, 1450184819, 23497, 711427, 521, 673, 519577, 1372062943, 56543, 811, 182309, 53077, 641, 349, 389
Offset: 1

Views

Author

Labos Elemer, Oct 25 2000

Keywords

Examples

			6th term in the sequence corresponds to 7th primorial = 510510 and 510509 = 61 * 8369, so a(7) = 61.
		

Crossrefs

Programs

  • Mathematica
    Map[If[PrimeQ@ #, #, FactorInteger[#][[1, 1]]] &, FoldList[#1 #2 &, Prime@ Range@ 36] - 1] (* Michael De Vlieger, Feb 18 2017 *)

Formula

a(n) = A020639(A057588(n)). - Amiram Eldar, Feb 13 2020

Extensions

More terms from Klaus Brockhaus, Larry Reeves (larryr(AT)acm.org) and Robert G. Wilson v, Apr 02 2001

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
Showing 1-10 of 12 results. Next