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-9 of 9 results.

A068869 Smallest number k such that n! + k is a square.

Original entry on oeis.org

0, 2, 3, 1, 1, 9, 1, 81, 729, 225, 324, 39169, 82944, 176400, 215296, 3444736, 26167684, 114349225, 255004929, 1158920361, 11638526761, 42128246889, 191052974116, 97216010329, 2430400258225, 1553580508516, 4666092737476, 565986718738441, 2137864362693921
Offset: 1

Views

Author

Amarnath Murthy, Mar 13 2002

Keywords

Comments

Observation: for n < 2000, only for n = 1, 4, 5, 6, 7, 8, 9, 10, 11, 13, 14, 15, 16 is a(n) a square (see A360210).
According to my conjecture that n! + n^2 != m^2 for n >= 1, m >= 0 (see A004664), for all terms: a(n) != n^2. - Alexander R. Povolotsky, Oct 06 2008
There are two cases: a(n) > sqrt(n!) in A182203 and a(n) < sqrt(n!) in A182204. - Artur Jasinski, Apr 13 2012

Examples

			a(6) = 9 as 6! + 9 = 729 is a square.
		

Crossrefs

Programs

  • Mathematica
    Table[ Ceiling[ Sqrt[n! ]]^2 - n!, {n, 1, 28}]
  • PARI
    A068869(n)=(sqrtint(n!-1)+1)^2-n!  \\ M. F. Hasler, Apr 01 2012
    
  • Python
    from math import factorial, isqrt
    def a(n): return (isqrt((f:=factorial(n))-1)+1)**2 - f
    print([a(n) for n in range(1, 30)]) # Michael S. Branicky, Jan 30 2023

Formula

a(n) = A055228(n)^2 - n! = ceiling(sqrt(n!))^2 - n! = A048761(n!) - n!.
a(n) <= A038202(n)^2, with equality for the n listed in the first comment. - M. F. Hasler, Apr 01 2012

Extensions

More terms from Vladeta Jovovic, Mar 21 2002
Edited by Robert G. Wilson v and N. J. A. Sloane, Mar 22 2002

A232176 Least positive k such that n^2 + triangular(k) is a square.

Original entry on oeis.org

1, 2, 6, 10, 14, 18, 7, 5, 8, 34, 6, 42, 46, 15, 54, 16, 14, 66, 70, 74, 23, 82, 9, 90, 17, 98, 102, 10, 110, 15, 25, 122, 126, 16, 39, 48, 40, 21, 150, 34, 158, 29, 54, 48, 30, 13, 182, 63, 55, 194, 56, 202, 14, 45, 214, 63, 222, 26, 41, 234, 31, 42, 39, 250, 32, 63
Offset: 0

Views

Author

Alex Ratushnyak, Nov 19 2013

Keywords

Comments

Triangular(k) = A000217(k) = k*(k+1)/2.
a(n) <= 4*n - 2, because with k = 4*n-2: n^2 + k*(k+1)/2 = n^2 + (4*n-2)*(4*n-1)/2 = 9*n^2 - 6*n + 1 = (3*n-1)^2.
The sequence of numbers n such that a(n)=n begins: 8, 800, 7683200 ... - a subsequence of A220186.

Crossrefs

Cf. A232179 (least k>=0 such that n^2 + triangular(k) is a triangular number).
Cf. A101157 (least k>0 such that triangular(n) + k^2 is a triangular number).
Cf. A232178 (least k>=0 such that triangular(n) + k^2 is a square).

Programs

  • Mathematica
    lpk[n_]:=Module[{k=1},While[!IntegerQ[Sqrt[n^2+(k(k+1))/2]],k++];k]; Array[ lpk,70,0] (* Harvey P. Dale, May 04 2018 *)
  • PARI
    a(n) = {k = 1; while (! issquare(n^2 + k*(k+1)/2), k++); k;} \\ Michel Marcus, Nov 20 2013
  • Python
    import math
    for n in range(77):
      n2 = n*n
      y=1
      for k in range(1,10000001):
        sum = n2 + k*(k+1)//2
        r = int(math.sqrt(sum))
        if r*r == sum:
          print(str(k), end=',')
          y=0
          break
      if y: print('-', end=',')
    

A232175 Least positive k such that n^3 + k^2 is a square, or 0 if there is no such k.

Original entry on oeis.org

0, 1, 3, 6, 10, 3, 21, 8, 36, 15, 55, 6, 78, 35, 15, 48, 136, 27, 171, 10, 42, 99, 253, 10, 300, 143, 81, 42, 406, 15, 465, 64, 88, 255, 35, 63, 666, 323, 91, 3, 820, 21, 903, 55, 66, 483, 1081, 48, 1176, 125, 85, 39, 1378, 81, 165, 28, 76, 783, 1711, 15, 1830, 899, 63
Offset: 1

Views

Author

Alex Ratushnyak, Nov 19 2013

Keywords

Comments

Numbers n such that a(n) = n*(n-1)/2 appear to be A000430.
n = 1 is the only number for which a(n) = 0. - T. D. Noe, Nov 21 2013

Crossrefs

Programs

  • Mathematica
    Join[{0}, Table[k = 1; While[! IntegerQ[Sqrt[n^3 + k^2]], k++]; k, {n, 2, 100}]] (* T. D. Noe, Nov 21 2013 *)
  • PARI
    a(n) = {k = 1; while (!issquare(n^3+k^2), k++); k;} \\ Michel Marcus, Nov 20 2013
  • Python
    import math
    for n in range(77):
       n3 = n*n*n
       y=1
       for k in range(1, 10000001):
         s = n3 + k*k
         r = int(math.sqrt(s))
         if r*r == s:
           print(k, end=', ')
           y=0
           break
       if y: print(end='-, ')
    
  • Python
    from _future_ import division
    from sympy import divisors
    def A232175(n):
        n3 = n**3
        ds = divisors(n3)
        for i in range(len(ds)//2-1,-1,-1):
            x = ds[i]
            y = n3//x
            a, b = divmod(y-x,2)
            if not b:
                return a
        return 0 # Chai Wah Wu, Sep 12 2017
    

A159082 Numbers whose squares added to 7! are prime.

Original entry on oeis.org

13, 23, 29, 59, 61, 73, 97, 101, 103, 109, 121, 127, 149, 169, 187, 191, 199, 221, 227, 251, 257, 263, 277, 299, 307, 317, 319, 331, 341, 367, 373, 383, 389, 397, 403, 407, 409, 433, 449, 451, 461, 463, 467, 491, 493, 499, 517, 527, 529, 533, 551, 563, 571
Offset: 1

Views

Author

Ulrich Krug (leuchtfeuer37(AT)gmx.de), Apr 05 2009

Keywords

Comments

1) Necessarily a(n) is not divisible by 2, 3, 5, 7.
2) Sequence is conjectured to be infinite.
3) It is conjectured that an infinite number of terms are primes.
4) Note that sequence contains a(k), a(k+1) prime twin pairs, first are (59,61), (461,463), (827,829), (1319,1321).
5) It is conjectured that an infinite number of a(n) are squares, first are 121=11^2, 169=13^2, 529=23^2, 841=29^2, 961=31^2, 1681=41^2, ...
6) m!+k^2=n^2 are the generalized Brown number triples (m,k,n).

Examples

			1) 7!+1=71^2, (7, 71) is the largest (of three) Brown pairs; Erdos conjectured that there are no others.
2) 7!+3^2=5049= 3^3 * 11 * 17, 7!+5^2=5065 = 5 * 1013, 7!+7^2=5089 = 7 * 727, 7!+9^2=5121 = 3^2 * 569, 7!+11^2=5161 = 13 * 397.
3) 7!+13^2=5209 prime, so a(1)=13.
		

References

  • R. K. Guy, Unsolved Problems in Number Theory (2nd ed.) New York: Springer-Verlag, p. 193, 1994
  • I. Niven, H. S. Zuckerman and H. L. Montgomery: An Introduction to the Theory of Numbers (5th ed.). Wiley Text Books, 1991
  • David Wells, Prime Numbers: The Most Mysterious Figures in Math. John Wiley and Sons. 2005

Crossrefs

Programs

  • Mathematica
    With[{s = 7!}, Select[Range[600], PrimeQ[#^2 + s] &]] (* Harvey P. Dale, Jun 17 2015 *)
  • PARI
    isok(n) = isprime(n^2+7!); \\ Michel Marcus, Jul 23 2013; corrected Jun 14 2022

Formula

7! + a(n)^2 = prime.

Extensions

Edited by N. J. A. Sloane, Apr 05 2009

A181896 Least value x solving x^2 - y^2 = n!

Original entry on oeis.org

5, 11, 27, 71, 201, 603, 1905, 6318, 21888, 78912, 295260, 1143536, 4574144, 18859680, 80014848, 348776640, 1559776320, 7147792848, 33526120320, 160785625902, 787685472000, 3938427360000, 20082117976800, 104349745817240, 552166953609600, 2973510046027938
Offset: 4

Views

Author

Artur Jasinski, Mar 31 2012

Keywords

Comments

Many of terms in this sequence are that same as A055228(n) but not all.
a(n) solves the Brocard-Ramanujan Problem, n! = a(n)^2 - 1, and thus (n, a(n)) are a pair of Brown Numbers, if and only if A038202(n) = 1. - Austin Hinkel, Dec 28 2022

Crossrefs

For least y value see A038202.
Cf. A055228.

Programs

  • Mathematica
    cc = {}; Do[f = n!/4; x = Max[Select[Divisors[f], # <= Sqrt[f] &]]; kk = f/x - x; AppendTo[cc, Sqrt[n! + kk^2]], {n, 4, 30}]; cc
  • PARI
    a(n)=my(N=n!,x=sqrtint(N));while(!issquare(x++^2-N),);x \\ Charles R Greathouse IV, Apr 10 2012

A269485 Least k > 0 such that n! + k^2 is prime.

Original entry on oeis.org

1, 1, 1, 1, 7, 11, 7, 13, 17, 31, 13, 1, 47, 17, 19, 19, 23, 73, 43, 29, 47, 31, 43, 29, 31, 37, 167, 1, 29, 43, 79, 229, 89, 71, 137, 37, 53, 1, 79, 131, 137, 1, 71, 83, 89, 89, 53, 97, 53, 101, 59, 173, 79, 71, 353, 191, 103, 523, 229, 191, 103, 401, 67, 257
Offset: 0

Views

Author

Jean-Marc Rebert, Feb 28 2016

Keywords

Comments

a(n) = A033932(n) = 1 for n in A002981.

Examples

			a(4) = 7, because 4! + 7^2 = 73 is prime and for 0 < i < 7, 4! + i^2 is not prime.
		

Crossrefs

Programs

  • Mathematica
    Table[SelectFirst[Range@ 10000, PrimeQ[n! + #^2] &], {n, 120}]
    (* Version 10, or *)
    Table[k = 1; While[! PrimeQ[n! + k^2], k++]; k, {n, 120}] (* Michael De Vlieger, Feb 28 2016 *)
  • PARI
    a(n) = {my(k=1); while (!isprime(n! + k^2), k++); k;} \\ Michel Marcus, Feb 29 2016

A181895 Difference between maximum and minimum positive value y in solutions to x^2 - y^2 = n!.

Original entry on oeis.org

4, 28, 176, 1258, 10070, 90692, 907184, 9979181, 119750111, 1556754911, 21794572379, 326918591535, 5230697470143, 88921857013919, 1600593426385151, 30411275101997759, 608225502043759679
Offset: 4

Views

Author

Artur Jasinski, Mar 31 2012

Keywords

Programs

  • Mathematica
    cc = {}; Do[f = n!/4; x = Max[Select[Divisors[f], # <= Sqrt[f] &]]; kk = f/x - x; kkk = ((n! - 4)/4); AppendTo[cc, kkk - kk], {n, 4, 20}]; cc

Formula

a(n) = A139174(n) - A038202(n).

A181899 Largest divisor of n!/4 which is less than sqrt(n!)/2.

Original entry on oeis.org

2, 5, 12, 35, 96, 288, 945, 3150, 10800, 39312, 147420, 571536, 2286144, 9424800, 39984000, 174283200, 779688000, 3573570000, 16761064320, 80379048750, 393826406400, 1969132032000, 10040487256800, 52174220175000, 276080056560000, 1486750296281250
Offset: 4

Views

Author

Artur Jasinski, Mar 31 2012

Keywords

Comments

Comment from A038202: Let f=n!/4 and let a(n) be the largest divisor of f such that a(n) < sqrt(f). Then A038202(n) = f/a(n) - a(n). The greatest k such that n!+k^2 is a square is f-1. The number of k for which n!+k^2 is a square is A038548(f). - T. D. Noe, Nov 02 2004

Crossrefs

Programs

  • Mathematica
    Table[f = n!/4; Select[Divisors[f], # <= Sqrt[f] &][[-1]], {n, 4, 20}]

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
Showing 1-9 of 9 results.