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.

A332682 a(n) = Sum_{k=1..n} (-1)^(k+1) * ceiling(n/k).

This page as a plain text file.
%I A332682 #13 Nov 25 2024 14:43:14
%S A332682 1,1,2,3,3,4,5,6,5,7,8,9,8,9,10,13,11,12,13,14,13,16,17,18,15,17,18,
%T A332682 21,20,21,22,23,20,23,24,27,25,26,27,30,27,28,29,30,29,34,35,36,31,33,
%U A332682 34,37,36,37,38,41,38,41,42,43,40,41,42,47,43,46,47,48,47,50
%N A332682 a(n) = Sum_{k=1..n} (-1)^(k+1) * ceiling(n/k).
%H A332682 Robert Israel, <a href="/A332682/b332682.txt">Table of n, a(n) for n = 1..10000</a>
%F A332682 G.f.: (x/(1 - x)) * (1 + Sum_{k>=2} x^k / (1 + x^k)).
%F A332682 G.f.: (x/(1 - x)) * (1 + Sum_{k>=1} (-1)^(k+1) * x^(2*k) / (1 - x^k)).
%F A332682 a(n) = (n mod 2) + Sum_{k=1..n-1} A048272(k).
%F A332682 a(n) = 1 + Sum_{k<=n-1} A325937(k). - _Robert Israel_, Nov 25 2024
%p A332682 f:= proc(n) local k; add((-1)^(k+1)*ceil(n/k),k=1..n) end proc:
%p A332682 map(f, [$1..100]); # _Robert Israel_, Nov 25 2024
%t A332682 Table[Sum[(-1)^(k + 1) Ceiling[n/k], {k, 1, n}], {n, 1, 70}]
%t A332682 nmax = 70; CoefficientList[Series[(x/(1 - x)) (1 + Sum[x^k/(1 + x^k), {k, 2, nmax}]), {x, 0, nmax}], x] // Rest
%o A332682 (PARI) a(n) = sum(k=1, n, (-1)^(k+1)*ceil(n/k)); \\ _Michel Marcus_, Feb 21 2020
%Y A332682 Cf. A006590, A048272, A059851, A275495, A325937.
%K A332682 nonn
%O A332682 1,3
%A A332682 _Ilya Gutkovskiy_, Feb 19 2020