OFFSET
1,3
FORMULA
a(n) = Sum_{k=1..n} Sum_{i=n+1..2n} sign(i mod k).
EXAMPLE
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.
PROG
(Python)
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
(Python)
from math import isqrt
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
CROSSREFS
KEYWORD
nonn
AUTHOR
Wesley Ivan Hurt, Feb 08 2022
STATUS
approved