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.

A376138 a(n) is the smallest k such that n = ab + cd with 1 <= a,b,c,d <= k.

This page as a plain text file.
%I A376138 #57 Jan 26 2025 09:05:27
%S A376138 1,2,2,2,2,3,2,3,3,3,3,3,4,3,4,4,3,4,4,4,4,5,4,4,5,5,4,5,5,5,4,5,5,5,
%T A376138 5,5,6,6,5,5,6,6,6,5,6,7,6,6,5,6,6,7,6,6,6,7,7,7,6,6,7,7,7,7,6,7,8,7,
%U A376138 7,7,6,7,7,8,8,7,7,7,8,8,8,8,7,7,8,9,8
%N A376138 a(n) is the smallest k such that n = ab + cd with 1 <= a,b,c,d <= k.
%C A376138 The least side length that is required to express n as the sum of two rectangular numbers.
%C A376138 The minimum height of an area-n generalized "L" polyomino (a union of two integer-side rectangles in portrait orientation).
%C A376138 The largest n such that a(n) = k is 2k^2 since that n can be written as k*k + k*k.
%H A376138 Glen Whitney, <a href="/A376138/b376138.txt">Table of n, a(n) for n = 2..10000</a>
%F A376138 a(n) = min_{i=1..n/2} max(A033677(i), A033677(n-i)).
%e A376138 For n = 7, we may write
%e A376138   7 = 1*1 + 2*3,
%e A376138   7 = 1*2 + 1*5,
%e A376138   7 = 1*3 + 2*2.
%e A376138 Of these, the first and third have the smallest value for the largest factor appearing. Therefore, a(7) = 3.
%p A376138 b:= proc(n) b(n):= min(select(x-> x^2>=n, numtheory[divisors](n))) end:
%p A376138 a:= proc(n) a(n):= min(seq(max(b(i), b(n-i)), i=1..n/2)) end:
%p A376138 seq(a(n), n=2..100);  # _Alois P. Heinz_, Oct 15 2024
%t A376138 b[n_] := SelectFirst[Divisors[n], #^2 >= n&];
%t A376138 a[n_] := Min[Table[Max[b[i], b[n-i]], {i, 1, n/2}]];
%t A376138 Table[a[n], {n, 2, 100}] (* _Jean-François Alcover_, Jan 26 2025, after _Alois P. Heinz_ *)
%o A376138 (Python)
%o A376138 from sympy import divisors
%o A376138 from functools import cache
%o A376138 @cache
%o A376138 def b(n): return next(x for x in divisors(n) if x**2 >= n)
%o A376138 def a(n): return min(max(b(i), b(n-i)) for i in range(1, n//2+1))
%o A376138 print([a(n) for n in range(2, 100)]) # _Michael S. Branicky_, Oct 15 2024 after _Alois P. Heinz_
%Y A376138 Cf. A033677 (as single rectangular number).
%K A376138 nonn
%O A376138 2,2
%A A376138 _Glen Whitney_, Oct 14 2024