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.

A351362 Number of ways the numbers from 1..n do not divide the numbers from n..2n-1.

This page as a plain text file.
%I A351362 #18 Oct 23 2023 17:21:20
%S A351362 0,1,4,8,14,22,32,42,57,72,88,108,129,151,177,203,232,262,295,329,367,
%T A351362 405,443,487,532,577,627,675,727,783,839,895,956,1018,1082,1148,1217,
%U A351362 1285,1357,1431,1506,1586,1664,1746,1832,1914,2002,2092,2186,2277,2374,2472,2568,2672
%N A351362 Number of ways the numbers from 1..n do not divide the numbers from n..2n-1.
%F A351362 a(n) = Sum_{k=1..n} Sum_{i=n..2n-1} sign(i mod k).
%F A351362 a(n) = n*(n+1) - 1 + A006218(n-1) - A006218(2n-1). - _Chai Wah Wu_, Feb 08 2022
%e A351362 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.
%o A351362 (Python)
%o A351362 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
%o A351362 (Python)
%o A351362 from math import isqrt
%o A351362 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
%Y A351362 Cf. A006218, A077024, A351355.
%K A351362 nonn
%O A351362 1,3
%A A351362 _Wesley Ivan Hurt_, Feb 08 2022