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.

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

This page as a plain text file.
%I A359479 #27 May 10 2023 04:30:57
%S A359479 1,2,-1,5,0,-3,-10,14,14,9,-2,-20,-33,-40,-25,71,54,54,35,5,26,15,-8,
%T A359479 -80,-80,-93,-93,-135,-164,-149,-180,204,237,220,255,255,218,199,238,
%U A359479 118,77,98,55,-11,-11,-34,-81,-369,-369,-369,-318,-396,-449,-449,-394,-562,-505,-534
%N A359479 a(1) = 1; a(n) = Sum_{k=2..n} (-1)^k * k * a(floor(n/k)).
%H A359479 Seiichi Manyama, <a href="/A359479/b359479.txt">Table of n, a(n) for n = 1..8191</a>
%F A359479 Sum_{k=1..n} (-1)^k * k * a(floor(n/k)) = 0 for n > 1.
%F A359479 G.f. A(x) satisfies -x * (1 - x) = Sum_{k>=1} (-1)^k * k * (1 - x^k) * A(x^k).
%t A359479 f[p_, e_] := If[e == 1, -p, 0]; f[2, e_] := If[e == 1, 1, 6*4^(e-2)]; s[1] = 1; s[n_] := Times @@ f @@@ FactorInteger[n]; Accumulate[Array[s, 100]] (* _Amiram Eldar_, May 09 2023 *)
%o A359479 (Python)
%o A359479 from functools import lru_cache
%o A359479 @lru_cache(maxsize=None)
%o A359479 def A359479(n):
%o A359479     if n <= 1:
%o A359479         return 1
%o A359479     c, j = 0, 2
%o A359479     k1 = n//j
%o A359479     while k1 > 1:
%o A359479         j2 = n//k1 + 1
%o A359479         c += ((j2>>1 if j2&1 else -(j2>>1))-(j>>1 if j&1 else -(j>>1)))*A359479(k1)
%o A359479         j, k1 = j2, n//j2
%o A359479     return c+(-(n+1>>1) if n&1 else n+1>>1)+(-(j>>1) if j&1 else j>>1) # _Chai Wah Wu_, Mar 31 2023
%Y A359479 Cf. A309288.
%K A359479 sign,look
%O A359479 1,2
%A A359479 _Seiichi Manyama_, Mar 31 2023