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.

A385454 Difference of the largest and smallest semiperimeters of an integral rectangle with area n.

Original entry on oeis.org

0, 0, 0, 1, 0, 2, 0, 3, 4, 4, 0, 6, 0, 6, 8, 9, 0, 10, 0, 12, 12, 10, 0, 15, 16, 12, 16, 18, 0, 20, 0, 21, 20, 16, 24, 25, 0, 18, 24, 28, 0, 30, 0, 30, 32, 22, 0, 35, 36, 36, 32, 36, 0, 40, 40, 42, 36, 28, 0, 45, 0, 30, 48, 49, 48, 50, 0, 48, 44, 54, 0, 56, 0
Offset: 1

Views

Author

James C. McMahon, Jun 29 2025

Keywords

Comments

For all noncomposite n, a(n) = 0.
For each square k^2, a(k^2) = (k^2 + 1) - 2*k = (k-1)^2.

Examples

			The largest semiperimeter of an integral rectangle with area 9 is 10 (1 x 9 rectangle); the smallest semiperimeter is 6 (3 x 3 rectangle). The difference, a(9) = 4.
		

Crossrefs

Cf. A063655.

Programs

  • Mathematica
    a[n_]:=1+n-2Median[Divisors[n]];Array[a,73]
  • Python
    from sympy import divisors
    def A385454(n):
        l = len(d:=divisors(n))
        return n+1-d[l-1>>1]-d[l>>1] # Chai Wah Wu, Jul 01 2025

Formula

a(n) = 1 + n - A063655(n).