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

A068527 Difference between smallest square >= n and n.

Original entry on oeis.org

0, 0, 2, 1, 0, 4, 3, 2, 1, 0, 6, 5, 4, 3, 2, 1, 0, 8, 7, 6, 5, 4, 3, 2, 1, 0, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9
Offset: 0

Views

Author

Vladeta Jovovic, Mar 21 2002

Keywords

Comments

The greedy inverse (sequence of the smallest k such that a(k)=n) starts 0, 3, 2, 6, 5, 11, 10, 18, 17, 27, 26, 38, 37, 51, 50, ... and appears to be given by A010000 and A002522, interleaved. - R. J. Mathar, Nov 17 2014

Crossrefs

Bisections: A348596, A350962.

Programs

Formula

a(n) = A048761(n) - n = ceiling(sqrt(n))^2 - n.
G.f.: (-x^2 + (x-x^2)*Sum_{m>=1} (1+2*m)*x^(m^2))/(1-x)^2. This sum is related to Jacobi Theta functions. - Robert Israel, Nov 17 2014

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

A226973 Difference between n! and the largest cube < n!.

Original entry on oeis.org

1, 1, 5, 16, 56, 208, 127, 1016, 4969, 47223, 264979, 789832, 7668081, 4272696, 130217625, 883909125, 9969785792, 52152119144, 128092980744, 2166664965184, 29992267884032, 272465658461528, 1588888484126208, 10747891377020979, 5480400487212279, 70703132766750784, 1908984584702271168
Offset: 1

Views

Author

Zak Seidov, Jun 25 2013

Keywords

Comments

Also, smallest number k such that n! - k is a cube.
Sequence is not monotonic: a(n) < a(n-1) for n: 7, 14, 25, 30, 51, 106, 168, 279, 288.

Examples

			a(2) = 2! - 1^3 = 1, a(3) = 3! - 1^3 = 5, a(4) = 4! - 3^3 = 16.
		

Crossrefs

Programs

  • Mathematica
    Join[{1}, Table[n! - Floor[(n!)^(1/3)]^3, {n, 2, 30}]]
  • PARI
    a(n)=my(N=n!);N-sqrtnint(N,3)^3 \\ Charles R Greathouse IV, Jun 25 2013

Formula

a(n) = n! - floor (n!^(1/3))^3 = A000142(n) - A214083(n)^3.

A240940 Least number k >= 0 such that n! - k is a perfect power.

Original entry on oeis.org

0, 1, 2, 8, 20, 44, 127, 320, 476, 3584, 12311, 4604, 74879, 414119, 2071775, 5703551, 11551671, 45680444, 442548224, 1960632176, 2657058876, 24923993276, 130518272975, 1478154932316, 5446454455004, 38610655379975, 204033398880671, 538347188396016, 3809155729331900, 27460809907547975, 52607402757814775
Offset: 1

Views

Author

Derek Orr, Aug 04 2014

Keywords

Crossrefs

Cf. A066857 (n! - k is a square), A226973.

Programs

  • PARI
    a(n)=for(k=0,n!,s=n!-k;if(ispower(s)||s==1,return(k)))
    n=1;while(n<50,print1(a(n),", ");n++)
    
  • PARI
    a(n)=for(k=1, n!, if(2^k>n!, kk=k; break)); if(kk==1, return(0)); L=List([]); for(i=2, kk, listinsert(L, n!-floor(n!^(1/i))^i, 1)); listsort(L); L[1]
    vector(40, n, a(n)) \\ faster program
Showing 1-4 of 4 results.