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-3 of 3 results.

A325939 Expansion of Sum_{k>=1} x^(2*k) / (1 + x^k).

Original entry on oeis.org

0, 1, -1, 2, -1, 1, -1, 3, -2, 1, -1, 3, -1, 1, -3, 4, -1, 1, -1, 3, -3, 1, -1, 5, -2, 1, -3, 3, -1, 1, -1, 5, -3, 1, -3, 4, -1, 1, -3, 5, -1, 1, -1, 3, -5, 1, -1, 7, -2, 1, -3, 3, -1, 1, -3, 5, -3, 1, -1, 5, -1, 1, -5, 6, -3, 1, -1, 3, -3, 1, -1, 7, -1, 1, -5, 3, -3, 1, -1, 7
Offset: 1

Views

Author

Ilya Gutkovskiy, Sep 09 2019

Keywords

Comments

Number of even divisors of n minus number of odd strong divisors of n (i.e. odd divisors > 1).

Crossrefs

Cf. A032741, A048272, A075997 (partial sums), A325937.

Programs

  • Mathematica
    nmax = 80; CoefficientList[Series[Sum[x^(2 k)/(1 + x^k), {k, 1, nmax}], {x, 0, nmax}], x] // Rest
    Table[DivisorSum[n, (-1)^# &, # > 1 &], {n, 1, 80}]
  • PARI
    A325939(n) = sumdiv(n, d, if(1==d,0,((-1)^d))); \\ Antti Karttunen, Sep 20 2019

Formula

G.f.: Sum_{k>=2} (-1)^k * x^k / (1 - x^k).
a(n) = Sum_{d|n, d>1} (-1)^d.
a(n) = 1 - A048272(n).

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

Original entry on oeis.org

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, 21, 20, 21, 22, 23, 20, 23, 24, 27, 25, 26, 27, 30, 27, 28, 29, 30, 29, 34, 35, 36, 31, 33, 34, 37, 36, 37, 38, 41, 38, 41, 42, 43, 40, 41, 42, 47, 43, 46, 47, 48, 47, 50
Offset: 1

Views

Author

Ilya Gutkovskiy, Feb 19 2020

Keywords

Crossrefs

Programs

  • Maple
    f:= proc(n) local k; add((-1)^(k+1)*ceil(n/k),k=1..n) end proc:
    map(f, [$1..100]); # Robert Israel, Nov 25 2024
  • Mathematica
    Table[Sum[(-1)^(k + 1) Ceiling[n/k], {k, 1, n}], {n, 1, 70}]
    nmax = 70; CoefficientList[Series[(x/(1 - x)) (1 + Sum[x^k/(1 + x^k), {k, 2, nmax}]), {x, 0, nmax}], x] // Rest
  • PARI
    a(n) = sum(k=1, n, (-1)^(k+1)*ceil(n/k)); \\ Michel Marcus, Feb 21 2020

Formula

G.f.: (x/(1 - x)) * (1 + Sum_{k>=2} x^k / (1 + x^k)).
G.f.: (x/(1 - x)) * (1 + Sum_{k>=1} (-1)^(k+1) * x^(2*k) / (1 - x^k)).
a(n) = (n mod 2) + Sum_{k=1..n-1} A048272(k).
a(n) = 1 + Sum_{k<=n-1} A325937(k). - Robert Israel, Nov 25 2024

A335021 a(n) = Sum_{d|n, 1 < d < n} (-1)^(d + 1).

Original entry on oeis.org

0, 0, 0, -1, 0, 0, 0, -2, 1, 0, 0, -2, 0, 0, 2, -3, 0, 0, 0, -2, 2, 0, 0, -4, 1, 0, 2, -2, 0, 0, 0, -4, 2, 0, 2, -3, 0, 0, 2, -4, 0, 0, 0, -2, 4, 0, 0, -6, 1, 0, 2, -2, 0, 0, 2, -4, 2, 0, 0, -4, 0, 0, 4, -5, 2, 0, 0, -2, 2, 0, 0, -6, 0, 0, 4, -2, 2, 0, 0, -6, 3, 0, 0, -4, 2, 0, 2, -4
Offset: 1

Views

Author

Ilya Gutkovskiy, May 19 2020

Keywords

Comments

Number of odd nontrivial divisors of n minus number of even nontrivial divisors of n.

Crossrefs

Programs

  • Mathematica
    Table[DivisorSum[n, (-1)^(# + 1) &, 1 < # < n &], {n, 1, 88}]
    nmax = 88; CoefficientList[Series[Sum[(-1)^(k + 1) x^(2 k)/(1 - x^k), {k, 2, nmax}], {x, 0, nmax}], x] // Rest
  • PARI
    a(n) = sumdiv(n, d, if ((d>1) && (dMichel Marcus, May 20 2020
    
  • Python
    from sympy import divisor_count
    def A335021(n): return 0 if n == 1 else (1-(m:=(~n & n-1).bit_length()))*divisor_count(n>>m)-((n&1)<<1) # Chai Wah Wu, Jul 01 2022

Formula

G.f.: Sum_{k>=2} (-1)^(k + 1) * x^(2*k) / (1 - x^k).
G.f.: - Sum_{k >= 2} x^(2*k)/(1 + x^k). - Peter Bala, Jan 12 2021
a(n) = A001227(n)*(1 - A007814(n)) - 1 + (-1)^n, if n > 1. - Sebastian Karlsson, Jan 14 2021
Showing 1-3 of 3 results.