OFFSET
1,3
FORMULA
a(n) = (1-(-1)^n)*(1+floor(sqrt(2*n-1)))/2-(((-1)^n-2*n-1)/2 + 2*Sum_{k=1..-1+floor(sqrt(2*n-2-(-1)^n))} floor((k+1)/2))*(-1)^n/2.
EXAMPLE
[9,1]
[7,1] [8,1] [8,2]
[5,1] [6,1] [6,2] [7,2] [7,3]
[3,1] [4,1] [4,2] [5,2] [5,3] [6,3] [6,4]
[1,1] [2,1] [2,2] [3,2] [3,3] [4,3] [4,4] [5,4] [5,5]
k 2 3 4 5 6 7 8 9 10
--------------------------------------------------------------------------
k Nonincreasing partitions of k
--------------------------------------------------------------------------
2 1,1
3 2,1
4 3,1,2,2
5 4,1,3,2
6 5,1,4,2,3,3
7 6,1,5,2,4,3
8 7,1,6,2,5,3,4,4
9 8,1,7,2,6,3,5,4
10 9,1,8,2,7,3,6,4,5,5
...
MATHEMATICA
Table[(1 - (-1)^n) (1 + Floor[Sqrt[2 n - 1]])/2 - (((-1)^n - 2 n - 1)/2 + 2 Sum[Floor[(k + 1)/2], {k, -1 + Floor[Sqrt[2 n - 2 - (-1)^n]]}]) (-1)^n/2, {n, 100}]
CROSSREFS
KEYWORD
nonn
AUTHOR
Wesley Ivan Hurt, Dec 05 2020
STATUS
approved