A086144 a(n) = 2*A071640(n) - n.
1, 0, 1, 2, 3, 4, 5, 4, 3, 2, 1, 2, 3, 4, 3, 4, 5, 6, 5, 6, 5, 4, 5, 6, 5, 4, 3, 2, 3, 2, 1, 2, 3, 2, 3, 4, 5, 6, 7, 6, 7, 6, 7, 8, 7, 6, 5, 6, 7, 6, 7, 8, 9, 10, 9, 10, 9, 8, 7, 8, 9, 8, 9, 8, 7, 6, 7, 8, 9, 8, 9, 10, 11, 10, 9, 10, 11, 10, 9, 8, 9, 10, 11, 10, 11, 10, 11, 12, 13, 14
Offset: 1
Keywords
Programs
-
Maple
A086144 := proc(n) option remember; if n=1 then 1 else if combinat[numbpart](n) mod 2 = 1 then 1 else -1 fi; % + A086144(n-1) fi end: seq(A086144(i),i=1..90); # Peter Luschny, Oct 05 2011
-
Mathematica
a071640[n_] := Sum[Mod[PartitionsP[i], 2], {i, 1, n}]; a[n_] := 2 a071640[n] - n; Array[a, 100] (* Jean-François Alcover, Jun 11 2019 *)
-
PARI
a(n) = my(x='x+O('x^(n+1)), p = 1/eta(x)); sum(i=1, n, (1-(-1)^(polcoeff(p, i)))) - n; \\ Michel Marcus, Jun 11 2019
Extensions
Erroneous data for n>55 replaced, keyword sign added by Peter Luschny, Oct 05 2011
Comments