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.

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

This page as a plain text file.
%I A361982 #18 Apr 02 2023 13:22:06
%S A361982 1,3,0,8,3,-3,-10,22,22,12,1,-23,-36,-50,-35,93,76,76,57,17,38,16,-7,
%T A361982 -103,-103,-129,-129,-185,-214,-184,-215,297,330,296,331,331,294,256,
%U A361982 295,135,94,136,93,5,5,-41,-88,-472,-472,-472,-421,-525,-578,-578,-523,-747,-690,-748
%N A361982 a(n) = 1 + Sum_{k=2..n} (-1)^k * k * a(floor(n/k)).
%H A361982 Seiichi Manyama, <a href="/A361982/b361982.txt">Table of n, a(n) for n = 1..8191</a>
%F A361982 Sum_{k=1..n} (-1)^k * k * a(floor(n/k)) = -1.
%F A361982 G.f. A(x) satisfies -x = Sum_{k>=1} (-1)^k * k * (1 - x^k) * A(x^k).
%o A361982 (Python)
%o A361982 from functools import lru_cache
%o A361982 @lru_cache(maxsize=None)
%o A361982 def A361982(n):
%o A361982     if n <= 1:
%o A361982         return 1
%o A361982     c, j = 1, 2
%o A361982     k1 = n//j
%o A361982     while k1 > 1:
%o A361982         j2 = n//k1 + 1
%o A361982         c += (((j2<<1)-1 if j2&1 else -(j2<<1)+1)+(-(j<<1)+1 if j&1 else (j<<1)-1)>>2)*A361982(k1)
%o A361982         j, k1 = j2, n//j2
%o A361982     return c+((-(n<<1)-1 if n&1 else (n<<1)+1)+(-(j<<1)+1 if j&1 else (j<<1)-1)>>2) # _Chai Wah Wu_, Apr 02 2023
%Y A361982 Partial sums of A332793.
%Y A361982 Cf. A347030, A361983.
%Y A361982 Cf. A068340.
%K A361982 sign,look
%O A361982 1,2
%A A361982 _Seiichi Manyama_, Apr 02 2023