%I #17 Oct 23 2023 17:22:26
%S 0,1,3,8,13,21,31,42,55,71,87,107,128,150,174,203,231,260,294,328,364,
%T 404,442,486,530,576,624,674,726,780,838,895,953,1017,1079,1146,1216,
%U 1284,1354,1430,1505,1583,1663,1745,1827,1913,2001,2091,2184,2275,2371,2471,2567,2669,2773
%N Number of ways the numbers from 1..n do not divide numbers from n+1..2n.
%F a(n) = Sum_{k=1..n} Sum_{i=n+1..2n} sign(i mod k).
%F a(n) = n*(n+1) + A006218(n) - A006218(2n). - _Chai Wah Wu_, Feb 08 2022
%e a(5) = 13; there are 13 ways the numbers from 1..5 do not divide the numbers from 6..10. 2 does not divide 7,9 (2 ways) + 3 does not divide 7,8,10 (3 ways) + 4 does not divide 6,7,9,10 (4 ways) + 5 does not divide 6,7,8,9 (4 ways) = 13 ways.
%o (Python)
%o def A351355(n): return 0 if n == 1 else n*n-sum(2*n//k for k in range(2,2*n))+sum(n//k for k in range(2,n)) # _Chai Wah Wu_, Feb 08 2022
%o (Python)
%o from math import isqrt
%o def A351355(n): return ((t:=isqrt(m:=n<<1))+(s:=isqrt(n)))*(t-s)+(sum(n//k for k in range(1,s+1))-sum(m//k for k in range(1,t+1))<<1)+n*(n+1) # _Chai Wah Wu_, Oct 23 2023
%Y Cf. A006218, A077024.
%K nonn
%O 1,3
%A _Wesley Ivan Hurt_, Feb 08 2022
|