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 A349216 #27 Feb 16 2022 01:56:04 %S A349216 0,0,1,2,4,8,13,20,30,40,53,70,88,110,137,166,200,240,281,328,382,438, %T A349216 501,572,646,728,819,910,1010,1120,1233,1356,1490,1628,1777,1938,2100, %U A349216 2274,2461,2652,2856,3074,3297,3534,3786,4040,4309,4594,4884,5190,5513,5842,6188,6552,6917 %N A349216 Number of ternary triples (u,v,w) with 1 <= u < v < w <= n. %C A349216 A triple of integers (u,v,w) is a ternary triple if in the ternary expansions of u,v,w, all three disagree at the least significant position at which any two disagree. %C A349216 Equivalently, (u,v,w) is a ternary triple if the highest power of three dividing 2w-u-v is greater than the highest power of three dividing gcd(w-u,w-v). %H A349216 Coen del Valle and Peter J. Dukes, <a href="https://arxiv.org/abs/2201.00897">Balancing permuted copies of multigraphs and integer matrices</a>, arXiv:2201.00897 [math.CO], 2022. %e A349216 For n = 7 the 13 ternary triples are (1, 2, 3), (2, 3, 4), (1, 3, 5), (3, 4, 5), (1, 2, 6), (2, 4, 6), (1, 5, 6), (4, 5, 6), (2, 3, 7), (1, 4, 7), (3, 5, 7), (2, 6, 7), (5, 6, 7). %t A349216 Array[Sum[Sum[Sum[Boole[IntegerExponent[w + w - u - v, 3] > IntegerExponent[GCD[w - u, w - v], 3]], {u, (v - 1)}], {v, 2, (w - 1)}], {w, 3, #}] &, 55] (* _Michael De Vlieger_, Feb 15 2022 *) %o A349216 (PARI) A349216(n) = sum(w=3,n,sum(v=2,(w-1),sum(u=1,(v-1),valuation(w+w-u-v,3) > valuation(gcd(w-u,w-v),3)))); \\ _Antti Karttunen_, Nov 13 2021 %o A349216 (SageMath) %o A349216 def a(n): %o A349216 t=3^ceil(log(n,3)) %o A349216 counter=0 %o A349216 for w in range(n): %o A349216 for v in range(w): %o A349216 for u in range(v): %o A349216 if min(gcd(w-u,3^t),gcd(w-v,3^t))<gcd(2*w-u-v,3^t): %o A349216 counter+=1 %o A349216 return counter %Y A349216 Cf. A061866, A005704, A038500, A007089, A007997. %K A349216 nonn,base %O A349216 1,4 %A A349216 _Peter J. Dukes_, Nov 10 2021