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.

A350221 a(n) = Sum_{k=1..n} (-1)^(k+1) * floor((n/k)^2).

This page as a plain text file.
%I A350221 #21 Oct 27 2023 21:17:12
%S A350221 1,3,8,12,21,29,40,52,67,83,100,116,140,160,185,210,237,264,298,327,
%T A350221 363,397,435,472,514,557,602,644,690,741,791,837,897,950,1009,1063,
%U A350221 1126,1185,1253,1313,1381,1450,1521,1593,1667,1739,1820,1894,1973,2054,2140
%N A350221 a(n) = Sum_{k=1..n} (-1)^(k+1) * floor((n/k)^2).
%F A350221 a(n) = A309081(n^2).
%t A350221 a[n_] := Sum[(-1)^(k + 1)*Floor[(n/k)^2], {k, 1, n}]; Array[a, 50] (* _Amiram Eldar_, Dec 20 2021 *)
%o A350221 (PARI) a(n) = sum(k=1, n, (-1)^(k+1)*(n^2\k^2));
%o A350221 (Python)
%o A350221 def A350221(n): return (m:=n**2)+sum(m//k**2 if k&1 else -(m//k**2) for k in range(2,n+1)) # _Chai Wah Wu_, Oct 27 2023
%Y A350221 Cf. A000290, A153818, A309081, A344720, A350222, A350224.
%K A350221 nonn
%O A350221 1,2
%A A350221 _Seiichi Manyama_, Dec 20 2021