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

A260375 Numbers k such that A260374(k) is a perfect square.

Original entry on oeis.org

0, 1, 2, 4, 5, 6, 7, 8, 10, 11, 14, 15, 16
Offset: 1

Views

Author

Keywords

Comments

There are a surprising number of small terms in this sequence.
Heuristic: The square root of x has an average distance of 1/4 to an integer, so |x - round(sqrt(x))^2| is around |x - (sqrt(x) - 1/4)^2| or about sqrt(x)/2, hence A260374(n) is around sqrt(n!)/2. By Stirling's approximation this is around (n/e)^(n/2) which is a square with probability (n/e)^(-n/4). The integral of this function converges, so this sequence should be finite. This heuristic is crude, though, because it does not model the extreme values of A260374. - Charles R Greathouse IV, Jul 23 2015
There are no further terms up to 10^5, so probably the list is complete. - Charles R Greathouse IV, Jul 23 2015

Examples

			6! = 720. The nearest perfect square is 729. The difference is 9, which is itself a perfect square. So, 6 is in this sequence.
		

Crossrefs

Programs

  • PARI
    is(n)=my(N=n!,s=sqrtint(N)); issquare(min(N-s^2, (s+1)^2-N)) \\ Charles R Greathouse IV, Jul 23 2015
    
  • Python
    from gmpy2 import isqrt, is_square
    A260375_list, g = [0], 1
    for i in range(1, 1001):
        g *= i
        s = isqrt(g)
        t = g-s**2
        if is_square(t if t-s <= 0 else 2*s+1-t):
            A260375_list.append(i) # Chai Wah Wu, Jul 23 2015

A260373 The nearest perfect square to n!

Original entry on oeis.org

1, 1, 1, 4, 25, 121, 729, 5041, 40401, 362404, 3629025, 39917124, 478996996, 6226945921, 87178467600, 1307674583296, 20922793332736, 355687416544329, 6402373660047556, 121645100663836929, 2432902009335560361, 51090942169052381124, 1124000727752683686724
Offset: 0

Views

Author

Keywords

Comments

a(n) is well defined as the squares are alternatingly odd and even and thus the average of two successive squares is not an integer and thus no integer is equidistant to two successive squares. - Chai Wah Wu, Jul 24 2015

Examples

			6! = 720. The nearest perfect square is 729.
		

Crossrefs

Programs

  • PARI
    a(n)=round(sqrt(n!))^2 \\ Charles R Greathouse IV, Jul 23 2015
    
  • Python
    from gmpy2 import isqrt
    A260373_list, g = [1], 1
    for i in range(1, 101):
        g *= i
        s = isqrt(g)
        t = s**2
        A260373_list.append(int(t if g-t-s <= 0 else t+2*s+1)) # Chai Wah Wu, Jul 23 2015

Formula

a(n) = A055227(n)^2.
Showing 1-2 of 2 results.