A385454 Difference of the largest and smallest semiperimeters of an integral rectangle with area n.
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
Keywords
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.
Links
- James C. McMahon, Table of n, a(n) for n = 1..10000
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).
Comments