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 A358558 #49 Nov 28 2022 09:59:46 %S A358558 0,0,0,1,1,3,3,6,6,10,10,14,14,20,20,27,27,33,33,41,41,51,51,59,59,71, %T A358558 71,83,83,91,91,106,106,122,122,134,134,152,152,168,168,180,180,200, %U A358558 200,222,222,238,238,258,258,282,282,300,300,324,324,352,352,368,368 %N A358558 a(n) is the number of pairs (k,m) of positive integers with 1 <= k < m <= n such that gcd(k,m) = 2^t, t > 0. %C A358558 Integers k and m such that gcd(k,m) = 2^t, t > 0, are called 2-Friendly in Project Euler (see link). %C A358558 If k=m were included then the number of pairs would A049690(floor(n/2)), and subtracting those cases is the 2nd formula. %C A358558 If gcd(k,m) = 2^t, t > 0 is replaced by gcd(k,m) = 2*t, t > 0, with 1 <= k < m <= n+4, sequence becomes A008805. %H A358558 Project Euler, <a href="https://projecteuler.net/problem=643">Problem 643: 2-Friendly</a>. %F A358558 a(2*n) = a(2*n+1). %F A358558 a(n) = A049690(floor(n/2)) - A000523(n). %e A358558 a(6)=3 because gcd(2,4)=2, gcd(2,6)=2, gcd(4,6)=2. %e A358558 12 and 18 are not 2-friendly because gcd(12,18) = 6. %t A358558 q[n_] := n > 1 && n == 2^IntegerExponent[n, 2]; a[n_] := Module[{c = 0}, Do[Do[If[q[GCD[k, m]], c++], {k, 2, m - 1}], {m, 2, n}]; c]; Array[a, 60] (* _Amiram Eldar_, Nov 23 2022 *) %o A358558 (PARI) a(n) = { my(res = 0); forvec(x = vector(2, i, [1,floor(n/2)]), c = gcd(x[1], x[2]); if(c == 1 << logint(c, 2), res++ ) , 2 ); res } \\ _David A. Corneth_, Nov 24 2022 %Y A358558 Cf. A000079, A000523, A008805, A049690. %K A358558 nonn %O A358558 1,6 %A A358558 _Bernard Schott_, Nov 23 2022