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.

Showing 1-1 of 1 results.

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

Original entry on oeis.org

1, -1, 9, -11, 41, -87, 241, -367, 1185, -2207, 5441, -10431, 24961, -46207, 124161, -218879, 503297, -1028607, 2319361, -4275199, 10434561, -19826687, 43847681, -85651455, 191225857, -365699071, 849625089, -1588051967, 3444539393, -7070580735, 15214903297
Offset: 1

Views

Author

Seiichi Manyama, Jun 08 2021

Keywords

Crossrefs

Programs

  • Mathematica
    a[n_] := Sum[(-2)^(n - Floor[n/k]), {k, 1, n}]; Array[a, 30] (* Amiram Eldar, Jun 08 2021 *)
  • PARI
    a(n) = sum(k=1, n, (-2)^(n-n\k));
    
  • PARI
    my(N=40, x='x+O('x^N)); Vec(sum(k=1, N, (-2)^(k-1)*x^k*(1-(-2*x)^k)/(1-(-2)^(k-1)*x^k))/(1+2*x))

Formula

G.f.: (1/(1 + 2*x)) * Sum_{k>=1} (-2)^(k-1)*x^k * (1 - (-2*x)^k)/(1 - (-2)^(k-1)*x^k).
Showing 1-1 of 1 results.