OFFSET
1,6
COMMENTS
For all noncomposite n, a(n) = 0.
For each square k^2, a(k^2) = (k^2 + 1) - 2*k = (k-1)^2.
LINKS
James C. McMahon, Table of n, a(n) for n = 1..10000
FORMULA
a(n) = 1 + n - A063655(n).
EXAMPLE
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.
MATHEMATICA
a[n_]:=1+n-2Median[Divisors[n]]; Array[a, 73]
PROG
(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
CROSSREFS
KEYWORD
nonn
AUTHOR
James C. McMahon, Jun 29 2025
STATUS
approved
