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.

A038759 a(n) = ceiling(sqrt(n))*floor(sqrt(n)).

Original entry on oeis.org

0, 1, 2, 2, 4, 6, 6, 6, 6, 9, 12, 12, 12, 12, 12, 12, 16, 20, 20, 20, 20, 20, 20, 20, 20, 25, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 36, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 49, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 64, 72, 72, 72, 72, 72, 72, 72
Offset: 0

Views

Author

Henry Bottomley, May 03 2000

Keywords

Comments

a(n) = n iff n is a square or a pronic (or heteromecic) number of form k(k+1). The sequence interleaves individual squares with 2k copies of each pronic.

Examples

			a(31) = 30 since 6 and 5 are on either side of the square root of 31 and 6*5 = 30.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := Ceiling[Sqrt[n]]*Floor[Sqrt[n]]; Array[a, 70, 0] (* Amiram Eldar, Dec 04 2022 *)
  • PARI
    a(n) = my(r,s=sqrtint(n,&r)); if(r, n-r+s, n); \\ Kevin Ryde, Jul 30 2022
  • Python
    from math import isqrt
    def A038759(n): return m+n+k if (m:=(k:=isqrt(n))**2-n) else n # Chai Wah Wu, Jul 28 2022
    

Formula

a(n) = A003059(n)*A000196(n) = n - A038760(n).
a(A002620(n)) = A002620(n). - Bernard Schott, Nov 06 2022
Sum_{n>=1} (-1)^(n+1)/a(n) = Pi^2/12 (A072691). - Amiram Eldar, Dec 04 2022