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 10 results.

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

A085692 Brocard's problem: squares which can be written as n!+1 for some n.

Original entry on oeis.org

25, 121, 5041
Offset: 1

Views

Author

Klaus Strassburger (strass(AT)ddfi.uni-duesseldorf.de), Jul 18 2003

Keywords

Comments

Next term, if it exists, is greater than 10^850. - Sascha Kurz, Sep 22 2003
No more terms < 10^20000. - David Wasserman, Feb 08 2005
The problem of whether there are any other terms in this sequence, Brocard's problem, has been unsolved since 1876. The known calculations give a(4) > (10^9)! = factorial(10^9). - Stefan Steinerberger, Mar 19 2006
I wrote a similar program sieving against the 40 smallest primes larger than 4*10^9 and can report that a(4) > factorial(4*10^9+1). In other words, it's now known that the only n <= 4*10^9 for which n!+1 is a square are 4, 5 and 7. C source code available on request. - Tim Peters (tim.one(AT)comcast.net), Jul 02 2006
Robert Matson claims to have verified that 4, 5, and 7 are the only values of n <= 10^12 for which n!+1 is a square. This implies that the next term, if it exists, is greater than (10^12+1)! ~ 1.4*10^11565705518115. - David Radcliffe, Oct 28 2019

Examples

			   5^2 =   25 = 4! + 1;
  11^2 =  121 = 5! + 1;
  71^2 = 5041 = 7! + 1.
		

References

  • R. Guy, "Unsolved Problems in Number Theory", 3rd edition, D25
  • Clifford A. Pickover, A Passion for Mathematics (2005) at 69, 306.
  • James J. Tattersall, Elementary Number Theory in Nine Chapters, Cambridge University Press, 1999, page 19.

Crossrefs

A085692, A146968, A216071 are all essentially the same sequence. - N. J. A. Sloane, Sep 01 2012

Programs

  • Mathematica
    Select[Range[0,100]!+1,IntegerQ[Sqrt[#]] &] (* Stefano Spezia, Jul 02 2025 *)
  • PARI
    A085692=select( issquare, vector(99,n,n!+1)) \\ M. F. Hasler, Nov 20 2018

Formula

a(n) = A216071(n)^2 = A146968(n)!+1 = A038507(A146968(n)). - M. F. Hasler, Nov 20 2018

A061057 Factorial splitting: write n! = x*y with x <= y and x maximal; sequence gives value of y-x.

Original entry on oeis.org

0, 1, 1, 2, 2, 6, 2, 18, 54, 30, 36, 576, 127, 840, 928, 3712, 20160, 93696, 420480, 800640, 1305696, 7983360, 55056804, 65318400, 326592000, 2286926400, 2610934480, 13680979200, 18906930876, 674165366496, 326850970500, 16753029012720, 16880461678080
Offset: 1

Views

Author

Ed Pegg Jr, May 28 2001

Keywords

Comments

Difference between central divisors of n!. - Jaume Oliver Lafont, Mar 13 2009
For n > 1, n! will never be a square, because of primes in the last half of the factors. Therefore the divisors of n! come in pairs (x,y) with x*y = n! and x < y. The sequence gives the difference y-x between the pair nearest to the square root of n!. - Alois P. Heinz, Jul 06 2009
a(n) = 2 iff n belongs to A146968. - Max Alekseyev, Feb 06 2010

Examples

			2! = 1*2, with difference of 1.
3! = 2*3, with difference of 1.
4! = 4*6, with difference of 2.
5! = 10*12, with difference of 2.
6! = 24*30, with difference of 6.
7! = 70*72 with difference of 2.
The corresponding central divisors are two units apart (equivalently, n!+1=A038507(n) is a square) for n = 4, 5, 7 (see A146968).
		

Crossrefs

Programs

  • Maple
    A060777 := proc(n) local d,nd ; d := sort(convert(numtheory[divisors](n!),list)) ; nd := nops(d) ; op(floor(1+nd/2),d) ; end:
    A060776 := proc(n) local d,nd ; d := sort(convert(numtheory[divisors](n!),list)) ; nd := nops(d) ; op(floor(nd/2),d) ; end:
    A061057 := proc(n) A060777(n)-A060776(n) ; end:
    seq(A061057(n),n=2..27) ; # R. J. Mathar, Mar 14 2009
  • Mathematica
    Do[ With[ {k = Floor[ Sqrt[ x! ] ] - Do[ If[ Mod[ x!, Floor[ Sqrt[ x! ] ] - n ] == 0, Return[ n ] ], {n, 0, 10000000} ]}, Print[ {x, "! =", k, x!/k, x!/k - k} ] ], {x, 3, 22} ]
    f[n_] := Block[{k = Floor@ Sqrt[n! ]}, While[ Mod[n!, k] != 0, k-- ]; n!/k - k]; Table[f@n, {n, 2, 32}] (* Robert G. Wilson v, Jul 11 2009 *)
    Table[d=Divisors[n!]; len=Length[d]; If[OddQ[len], 0, d[[1 + len/2]] - d[[len/2]]], {n, 34}] (* Vincenzo Librandi, Jan 02 2016 *)
  • PARI
    for(k=2,25,d=divisors(k!);print(d[#d/2+1]-d[#d/2])) \\ Jaume Oliver Lafont, Mar 13 2009
    
  • Python
    from math import isqrt, factorial
    from sympy import divisors
    def A061057(n):
        k = factorial(n)
        m = max(d for d in divisors(k,generator=True) if d <= isqrt(k))
        return k//m-m # Chai Wah Wu, Apr 06 2022

Formula

a(n) = A060777(n) - A060776(n).
a(n) = A056737(A000142(n)). - Pontus von Brömssen, Jul 15 2023

Extensions

More terms from Dean Hickerson, Jun 13 2001
Edited by N. J. A. Sloane Jul 07 2009 at the suggestion of R. J. Mathar and Alois P. Heinz
a(41) from Robert G. Wilson v, Oct 03 2014

A078778 Numbers n such that n!+1 is a semiprime.

Original entry on oeis.org

4, 5, 6, 7, 8, 10, 13, 14, 19, 20, 24, 25, 26, 28, 34, 38, 48, 54, 55, 59, 71, 75, 92, 109, 114, 115
Offset: 1

Views

Author

Jason Earls, Jan 09 2003

Keywords

Comments

Subsequence of (and likely is equal to) the union of A146968 and A181764. - Max Alekseyev, May 28 2015
Note that the two prime factors of 38!+1 = 523022617466601111760007224100074291200000001 = 14029308060317546154181 * 37280713718589679646221 both have 23 decimal digits. Are there any other terms in this sequence other than 4,5,7 and 38 with this property?
a(27) > 139. - Robert Price, Apr 11 2019
Other terms in this sequence: 392, 551, 601, 770, 772, 878, 1033, 1320, 1831, 2620, 2808, 3752, 4233, 4616, 4984, 7260. - Chai Wah Wu, Feb 28 2020

Examples

			4 is in the sequence because 4!+1=25=5*5 is semiprime. But 9 is not in the sequence because 9!+1=19*71*269 is not semiprime. - _Sean A. Irvine_, Nov 15 2009
		

Crossrefs

Programs

  • Magma
    IsSemiprime:=func< n | &+[ k[2]: k in Factorization(n) ] eq 2 >; [n: n in [1..60] | IsSemiprime(Factorial(n)+1)]; // Vincenzo Librandi, May 26 2015
  • Mathematica
    Select[Range[100], Plus@@Last/@FactorInteger[#! + 1]==2 &] (* Vincenzo Librandi, May 26 2015 *)
    Select[Range[100],PrimeOmega[#!+1]==2&] (* Harvey P. Dale, Mar 19 2017 *)
  • PARI
    { fp(a,b)=local(c,d,r); for(n=a,b,r=n!+1; c=vecmin(factor(r)[, 1]~); d=vecmax(factor(r)[,1]~); if(bigomega(r)==2 && isprime(c) && isprime(d), print1(n" ");)) } fp(1,100)
    

Extensions

Term 109 from Sean A. Irvine, Nov 15 2009
Term 114 (factored by Womack et al.) from Sean A. Irvine, May 25 2015
Term 115 (factored by Womack et al.) from Sean A. Irvine, Feb 08 2016

A064237 Numbers k such that k! + 1 is divisible by a square.

Original entry on oeis.org

4, 5, 7, 12, 23
Offset: 1

Views

Author

Vladeta Jovovic, Sep 22 2001

Keywords

Comments

229 is another term because 613^2 divides 229!+1. See A115091 for primes whose square divides m!+1 for some m. An examination of the factorizations of m!+1 for m<=100 found no additional squares. - T. D. Noe, Mar 01 2006
562 is also a term because 562!+1 is divisible by 563^2. - Vladeta Jovovic, Mar 30 2004
A web search reveals that for 1 <= k <= 228 there are 82 values of k for which k! + 1 has not been completely factored (the smallest is k=103), so showing that 229 and 562 are indeed the next two terms will be a huge task. I checked that k!+1 is not divisible by p^2 for k <= 1000 and prime p < 10^8. - Francois Brunault, Nov 23 2008
It is very likely that 229 and 562 are the next two terms, but this has not yet been proved. - Francois Brunault, Nov 29 2008
Contains A007540(n)-1 for all n. That sequence is conjectured to be infinite. - Robert Israel, Jul 04 2016
This sequence includes A146968 (solutions of Brocard's problem). - Salvador Cerdá, Mar 08 2016
If k > 562 and k! + 1 is divisible by p^2 where p is prime, then either k > 10000 or p > 2038074743 (the hundred millionth prime). - Jason Zimba, Oct 21 2021

Examples

			4 is in the sequence because 4! + 1 = 5^2.
5 is in the sequence because 5! + 1 = 11^2.
6 is not in the sequence because 6! + 1 = 721
7 is in the sequence because 7! + 1 = 71^2.
12 is in the sequence because 12! + 1 = 13^2 * 2834329.
23 is a term because 23!+1 = 47^2*79*148139754736864591.
From _Thomas Richard_, Aug 31 2021: (Start)
229 and 562 are terms because
229!+1 = 613^2 * 38669 * 1685231 * 3011917759 * (417-digit composite)
562!+1 = 563^2 * 64467346976659839517037 * 112870688711507255213769871 * 63753966393108716329397432599379239 * (1214-digit prime). (End)
		

Crossrefs

Cf. A007540 (Wilson primes), A115091, A146968, A038507, A085692.

Programs

  • Maple
    remove(t -> numtheory:-issqrfree(t!+1), [$1..50]); # Robert Israel, Jul 04 2016
  • Mathematica
    Flatten[Position[MoebiusMu[Range[30]!+1], 0]]; (* T. D. Noe, Mar 01 2006, Nov 21 2008 *)
  • PARI
    lista(nn) = for(n=1, nn, if(!issquarefree(n!+1), print1(n, ", "))); \\ Altug Alkan, Mar 08 2016

Extensions

Example corrected by T. D. Noe, Nov 26 2008

A216071 Brocard's problem: positive integers m such that m^2 = n! + 1 for some n.

Original entry on oeis.org

5, 11, 71
Offset: 1

Views

Author

V. Raman, Sep 01 2012

Keywords

Comments

See A085692 and A146968 for links, references and comments. - M. F. Hasler, Nov 20 2018

Crossrefs

A085692, A146968, A216071 are all essentially the same sequence. - N. J. A. Sloane, Sep 01 2012

Programs

Formula

a(n) = A000196(A085692(n)) = A000196(A038507(A146968(n))) where A000196 = sqrt and A038507(n) = n! + 1. - M. F. Hasler, Nov 20 2018

A163524 The pairs (x,y) such that x^2 = 1+factorial(y).

Original entry on oeis.org

5, 4, 11, 5, 71, 7
Offset: 1

Views

Author

Vincenzo Librandi, Jul 30 2009

Keywords

Comments

The main entry for this relation is the bisection in A146968.

Examples

			71^2 = 7!+1, which introduces (71,7) into the sequence.
		

Extensions

Reference to main sequence added by R. J. Mathar, Aug 02 2009

A232802 Number of solution pairs (x,y) for x <= 11 such that x! + n = y^2 (Brocard-Ramanujan Diophantine equation) is soluble over the integers.

Original entry on oeis.org

3, 1, 2, 0, 0, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 2, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 1, 1, 1, 0
Offset: 1

Views

Author

Frank M Jackson, Nov 30 2013

Keywords

Comments

The Mathematica program will find the number of integer pairs (x,y) solving x!+n = y^2 for each n from 1 to 200 with x not exceeding 11. Dabrowski showed that the abc conjecture implies only finite solutions for each n. Berndt and Galway found that 11 was the highest value that x reached for a solution with n in the range 1 to 2500 and could find no further solution pairs (x,y) in that range even when x was increased to 10^5.
For n = 1 the number of solutions and arbitrary x is Brocard's problem, and it is conjectured - but verified only in the range x <= 10^12 - that there are 3 solution pairs (x,y): (4,5), (5,11), (7,71). - Georg Fischer, Nov 27 2020

Crossrefs

Cf. A085692, A146968, A216071 (Brocard's problem; all essentially the same sequence).

Programs

  • Mathematica
    Table[Length@Select[Sqrt[Range[11]!+n], IntegerQ[#] &], {n, 1, 200}]

Extensions

Definition narrowed by Georg Fischer, Nov 27 2020

A273932 Integers m such that ceiling(sqrt(m!)) is prime.

Original entry on oeis.org

2, 3, 4, 5, 7, 21, 2132, 3084, 9301
Offset: 1

Views

Author

Salvador Cerdá, Jun 04 2016

Keywords

Comments

This sequence includes the known solutions of Brocard's problem as of 2016 (see A146968).

Examples

			3 is a term because 3! = 6, sqrt(6) = 2.449489742783178..., the ceiling of which is 3, which is prime.
4 is a term because 4! = 24, sqrt(24) = 4.898979485566356..., the ceiling of which is 5, which is prime.
		

Crossrefs

Cf. A055228 (ceiling(sqrt(n!))), A146968.

Programs

  • Mathematica
    Select[Range[3200], PrimeQ[Ceiling[Sqrt[#!]]] &]
  • Python
    from math import isqrt, factorial
    from itertools import count, islice
    from sympy import isprime
    def A273932_gen(): # generator of terms
        return filter(lambda n:isprime(1+isqrt(factorial(n)-1)),count(1))
    A273932_list = list(islice(A273932_gen(),7)) # Chai Wah Wu, Jul 29 2022

Extensions

a(9) from Giovanni Resta, Jun 20 2016

A321883 Nonnegative integers n for which n! + 1 is not a square.

Original entry on oeis.org

0, 1, 2, 3, 6, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69
Offset: 1

Views

Author

Felix Fröhlich, Nov 20 2018

Keywords

Comments

Complement of A146968 = positive integers n such that n!+1 is a square (Brocard's problem, so far {4, 5, 7} are the only known terms).
A weak form of Szpiro's conjecture implies that there are only finitely many nonnegative integers that are not in the sequence (cf. Overholt, 1993).

Crossrefs

Programs

  • Mathematica
    Select[Range[0,100], !IntegerQ[Sqrt[#!+1]] &] (* Amiram Eldar, Nov 21 2018 *)
  • PARI
    select( is(n)=!issquare(n!+1), [0..99]) \\ M. F. Hasler, Nov 20 2018
Showing 1-10 of 10 results.