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.

A349360 Number of positive integer pairs (s,t), with s,t <= n and s <= t such that either both s and t divide n or both do not.

This page as a plain text file.
%I A349360 #23 Feb 04 2025 07:18:03
%S A349360 1,3,4,7,9,13,18,20,27,31,48,42,69,65,76,81,123,99,156,126,163,181,
%T A349360 234,172,259,263,286,274,381,289,438,372,445,475,506,423,633,605,640,
%U A349360 564,783,631,864,762,801,913,1038,796,1087,1011,1138,1102,1329,1117,1336,1212,1441
%N A349360 Number of positive integer pairs (s,t), with s,t <= n and s <= t such that either both s and t divide n or both do not.
%H A349360 Amiram Eldar, <a href="/A349360/b349360.txt">Table of n, a(n) for n = 1..10000</a>
%F A349360 a(n) = A184389(n) + A335567(n). - _Alois P. Heinz_, Nov 15 2021
%F A349360 a(n) = A000005(n)*(A000005(n)-n) + n(n+1)/2. - _Chai Wah Wu_, Nov 19 2021
%F A349360 a(p) = (p^2 - 3*p + 8)/2 for primes p. - _Wesley Ivan Hurt_, Nov 28 2021
%e A349360 a(5) = 9; There are 9 positive integer pairs (s,t), with s <= t such that both s and t divide 5 or both do not. They are (1,1), (1,5), (2,2), (2,3), (2,4), (3,3), (3,4), (4,4), (5,5).
%p A349360 a:= n-> add(add(`if`(irem(n, j)>0 xor irem(n, i)=0, 1, 0), i=1..j), j=1..n):
%p A349360 seq(a(n), n=1..57);  # _Alois P. Heinz_, Nov 15 2021
%t A349360 a[n_] := Module[{d = DivisorSigma[0, n]}, n*(n+1)/2 - d*(n-d)]; Array[a, 100] (* _Amiram Eldar_, Feb 04 2025 *)
%o A349360 (Python)
%o A349360 from sympy import divisor_count
%o A349360 def A349360(n):
%o A349360     m = divisor_count(n)
%o A349360     return m*(m-n) + n*(n+1)//2 # _Chai Wah Wu_, Nov 19 2021
%o A349360 (PARI) a(n) = {my(d = numdiv(n)); n*(n+1)/2 - d*(n-d);} \\ _Amiram Eldar_, Feb 04 2025
%Y A349360 Cf. A000005, A184389, A335567.
%K A349360 nonn,easy
%O A349360 1,2
%A A349360 _Wesley Ivan Hurt_, Nov 15 2021