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.
%I A385084 #38 Jul 22 2025 21:46:34 %S A385084 2,12,8,6,12,10,14,14,12,16,20,22,18,22,26,20,24,28,26,30,30,28,36,34, %T A385084 30,38,36,36,42,38,42,44,40,44,46,42,48,48,54,50,50,56,52,58,58,54,60, %U A385084 60,56,62,66,64,64,68,66,66,70,68,74,74,70,76,76,72,78,78,80 %N A385084 Smallest integer value of Manhattan(v) + Euclidean(v) where v is a vector of n positive integers, and Manhattan(v) = Sum v[i] and Euclidean(v) = sqrt(Sum v[i]^2). %C A385084 Manhattan and Euclidean are distance measures from the origin for v as coordinates of a point in n-dimensional space. %C A385084 Integer Euclidean(v) requires that v is a Pythagorean n-tuple. %C A385084 These distances are a walk from the origin by a positive integer number of unit steps in each of the n dimensions, and a return to the origin by a straight line which is also an integer number of unit steps. %C A385084 When n is a square, a(n) = n + sqrt(n) from v all 1's. %e A385084 For n=2, v is the legs of a Pythagorean triangle and the smallest Manhattan + Euclidean is a(2) = 12 from v = {3,4}. %e A385084 a(3) = 8 because 1 + 2 + 2 + sqrt(1^2 + 2^2 + 2^2) = 1 + 2 + 2 + 3 = 8. %e A385084 a(4) = 6 because 1 + 1 + 1 + 1 + sqrt(1^2 + 1^2 + 1^2 + 1^2) = 1 + 1 + 1 + 1 + 2 = 6. %e A385084 a(29) = 42: 3^2 + (4 * 2^2) + (24 * 1^2) = 7^2, and 6^2 + (28 * 1^2) = 8^2 (first term with multiple different examples). %o A385084 (PARI) a(n)={my(r=oo); for(c=0, oo, if(n+sqrtint(n-1)+1+c>=r, return(r)); forpart(p=c, my(s=sum(i=1, #p, (p[i]+1)^2)+(n-#p)); if(issquare(s), r=min(r, n+c+sqrtint(s))), , n))} %K A385084 nonn %O A385084 1,1 %A A385084 _Charles L. Hohn_, Jun 17 2025