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.

A386881 a(n) is the number of occurrences of n in A386838.

This page as a plain text file.
%I A386881 #27 Aug 22 2025 04:33:20
%S A386881 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,
%T A386881 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,
%U A386881 36,16,24,7,49,12,21,20,42,10,42,12,34,13,36,10,69,15,23,23,36
%N A386881 a(n) is the number of occurrences of n in A386838.
%C A386881 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.
%C A386881 The offset is 1 since 0 occurs infinitely many times in A386838 (e.g., A386838(k) = 0 when A001481(k) is square).
%C A386881 The range in which n can occur in A386838 is bounded above by 2*n^2.
%C A386881 Does every integer n > 0 appear in this sequence?
%e A386881 a(5) = 2 since 5 appears twice in A386838.
%o A386881 (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)
%Y A386881 Cf. A001481, A386838.
%K A386881 nonn,changed
%O A386881 1,2
%A A386881 _Miles Englezou_, Aug 06 2025