login
A386881
a(n) is the number of occurrences of n in A386838.
0
1, 2, 2, 4, 2, 5, 2, 7, 4, 7, 3, 11, 4, 7, 6, 13, 3, 14, 5, 13, 7, 11, 3, 24, 7, 11, 8, 20, 4, 21, 8, 20, 10, 15, 7, 33, 7, 14, 12, 29, 4, 30, 8, 22, 15, 19, 7, 45, 10, 22, 14, 30, 8, 34, 12, 36, 16, 24, 7, 49, 12, 21, 20, 42, 10, 42, 12, 34, 13, 36, 10, 69, 15, 23, 23, 36
OFFSET
1,2
COMMENTS
A386838(k) is the minimal area of the graph formed under the requirement that the straight line drawn from (0,0) to (x,y) (where x^2 + y^2 = k = A001481(n)) passes through an enclosed space on the square lattice and its edges are either vertical or horizontal. If A001481(n) = x^2 + y^2 for multiple x and y, then x and y are chosen such that A386838(A001481(n)) is minimal. a(n) is the number of graphs with area n, and equivalently the number of numbers of the form x^2 + y^2 = A001481(n) such that n = x + y - gcd(x,y) for such minimal x and y.
The offset is 1 since 0 occurs infinitely many times in A386838 (e.g., A386838(k) = 0 when A001481(k) is square).
The range in which n can occur in A386838 is bounded above by 2*n^2.
Does every integer n > 0 appear in this sequence?
EXAMPLE
a(5) = 2 since 5 appears twice in A386838.
PROG
(PARI) a(n) = my(f, A = []); (f(n) = my(g, S, T = []); (g(n) = my(P = []); for(x = 0, sqrtint(n), my(y2 = n - x^2); if(issquare(y2), my(y = sqrtint(y2)); if(x <= y, P = concat(P, [[x, y]])))); return(P)); S = g(n); if(#S == 0, return(0), for(k = 1, #S, T = concat(T, S[k][1] + S[k][2] - gcd(S[k][1], S[k][2]))); return(vecmin(T)))); for(k = 1, 2*n^2, if(f(k) == n, A = concat(A, f(k)))); return(#A)
CROSSREFS
Sequence in context: A056148 A304442 A057567 * A353845 A217895 A328720
KEYWORD
nonn
AUTHOR
Miles Englezou, Aug 06 2025
STATUS
approved