OFFSET
1,3
FORMULA
a(n) = Sum_{k=1..n} Sum_{i=n..2n-1} sign(i mod k).
EXAMPLE
a(5) = 14; there are 14 ways that the numbers 1..5 do not divide the numbers 5..9. 2 does not divide 5,7,9 (3 ways) + 3 does not divide 5,7,8 (3 ways) + 4 does not divide 5,6,7,9 (4 ways) + 5 does not divide 6,7,8,9 (4 ways) = 14 ways.
PROG
(Python)
def A351362(n): return 1 if n == 2 else n*n-1-sum((2*n-1)//k for k in range(2, 2*n-1))+sum((n-1)//k for k in range(2, n-1)) # Chai Wah Wu, Feb 08 2022
(Python)
from math import isqrt
def A351362(n): return ((t:=isqrt(m:=(n<<1)-1))+(s:=isqrt(r:=n-1)))*(t-s)+(sum(r//k for k in range(1, s+1))-sum(m//k for k in range(1, t+1))<<1)+n*(n+1)-1 # Chai Wah Wu, Oct 23 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Wesley Ivan Hurt, Feb 08 2022
STATUS
approved