A325937 Expansion of Sum_{k>=1} (-1)^(k + 1) * x^(2*k) / (1 - x^k).
0, 1, 1, 0, 1, 1, 1, -1, 2, 1, 1, -1, 1, 1, 3, -2, 1, 1, 1, -1, 3, 1, 1, -3, 2, 1, 3, -1, 1, 1, 1, -3, 3, 1, 3, -2, 1, 1, 3, -3, 1, 1, 1, -1, 5, 1, 1, -5, 2, 1, 3, -1, 1, 1, 3, -3, 3, 1, 1, -3, 1, 1, 5, -4, 3, 1, 1, -1, 3, 1, 1, -5, 1, 1, 5, -1, 3, 1, 1, -5
Offset: 1
Links
- Antti Karttunen, Table of n, a(n) for n = 1..65537
Programs
-
Mathematica
nmax = 80; CoefficientList[Series[Sum[(-1)^(k + 1) x^(2 k)/(1 - x^k), {k, 1, nmax}], {x, 0, nmax}], x] // Rest Table[-DivisorSum[n, (-1)^# &, # < n &], {n, 1, 80}]
-
PARI
A325937(n) = -sumdiv(n, d, if(d==n,0,((-1)^d))); \\ Antti Karttunen, Sep 20 2019
Formula
G.f.: Sum_{k>=2} x^k / (1 + x^k).
a(n) = -Sum_{d|n, d
a(n) = A048272(n) + (-1)^n.
A264400 Number of parts of even multiplicities in all the partitions of n.
0, 0, 1, 0, 3, 2, 6, 6, 15, 15, 29, 34, 58, 70, 109, 132, 199, 246, 348, 435, 601, 746, 1005, 1252, 1653, 2053, 2666, 3298, 4231, 5219, 6608, 8124, 10198, 12476, 15525, 18927, 23374, 28387, 34823, 42122, 51376, 61922, 75098, 90200, 108874, 130298, 156564, 186777, 223490, 265779, 316799
Offset: 0
Keywords
Comments
a(n) = Sum_{k>=0} k*A264399(n,k).
Examples
a(6) = 6 because we have [6], [5,1], [4,2], [4,1*,1], [3*,3], [3,2,1], [3,1,1,1], [2,2,2], [2*,2,1*,1], [2,1*,1,1,1], and [1*,1,1,1,1,1] (the 6 parts with even multiplicities are marked).
Links
- Vaclav Kotesovec, Table of n, a(n) for n = 0..10000 (terms 0..1000 from Alois P. Heinz)
Programs
-
Maple
g := (sum(x^(2*j)/(1+x^j), j = 1 .. 100))/(product(1-x^j, j = 1 .. 100)): gser := series(g, x = 0, 70): seq(coeff(gser, x, n), n = 0 .. 60);
-
Mathematica
Needs["Combinatorica`"]; Table[Count[Last /@ Flatten[Tally /@ Combinatorica`Partitions@ n, 1], k_ /; EvenQ@ k], {n, 0, 50}] (* Michael De Vlieger, Nov 21 2015 *) Table[Sum[(1 - 2*DivisorSigma[0, 2*k] + 3*DivisorSigma[0, k]) * PartitionsP[n-k], {k, 1, n}], {n, 0, 50}] (* Vaclav Kotesovec, Jun 14 2025 *)
-
PARI
{ my(n=50); Vec(sum(k=1, n, x^(2*k)/(1+x^k) + O(x*x^n)) / prod(k=1, n, 1-x^k + O(x*x^n)), -(n+1)) } \\ Andrew Howroyd, Dec 22 2017
Formula
G.f.: g(x) = (Sum_{j>=1} (x^(2j)/(1+x^j))) / Product_{k>=1} (1-x^k).
A330926 a(n) = Sum_{k=1..n} (ceiling(n/k) mod 2).
1, 1, 2, 1, 3, 2, 3, 2, 5, 3, 4, 3, 6, 5, 6, 3, 7, 6, 7, 6, 9, 6, 7, 6, 11, 9, 10, 7, 10, 9, 10, 9, 14, 11, 12, 9, 13, 12, 13, 10, 15, 14, 15, 14, 17, 12, 13, 12, 19, 17, 18, 15, 18, 17, 18, 15, 20, 17, 18, 17, 22, 21, 22, 17, 23, 20, 21, 20, 23, 20, 21, 20, 27, 26, 27, 22, 25, 22, 23, 22
Offset: 1
Keywords
Comments
a(n) = number of terms among {ceiling(n/k)}, 1 <= k <= n, that are odd.
Links
- Alois P. Heinz, Table of n, a(n) for n = 1..10000
Crossrefs
Programs
-
Maple
b:= n-> add((-1)^d, d=numtheory[divisors](n)): a:= proc(n) option remember; `if`(n>0, 1+b(n-1)+a(n-1), 0) end: seq(a(n), n=1..80); # Alois P. Heinz, May 25 2020
-
Mathematica
Table[Sum[Mod[Ceiling[n/k], 2], {k, 1, n}], {n, 1, 80}] Table[n - Sum[DivisorSum[k, (-1)^(# + 1) &], {k, 1, n - 1}], {n, 1, 80}] nmax = 80; CoefficientList[Series[x/(1 - x) (1 + Sum[x^(2 k)/(1 + x^k), {k, 1, nmax}]), {x, 0, nmax}], x] // Rest
-
PARI
a(n) = sum(k=1, n, ceil(n/k) % 2); \\ Michel Marcus, May 25 2020
-
Python
from math import isqrt def A330926(n): return n+(s:=isqrt(n-1))**2-((t:=isqrt(m:=n-1>>1))**2<<1)-(sum((n-1)//k for k in range(1,s+1))-(sum(m//k for k in range(1,t+1))<<1)<<1) # Chai Wah Wu, Oct 23 2023
A335021 a(n) = Sum_{d|n, 1 < d < n} (-1)^(d + 1).
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
Comments
Number of odd nontrivial divisors of n minus number of even nontrivial divisors of n.
Links
- David A. Corneth, Table of n, a(n) for n = 1..10000
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) && (d
Michel 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
Comments