#include <iostream>
using namespace std;

int dp[10001][10001], n, s;

void set(){
    for(int i = 0; i <= 10000; i++){
        dp[1][i] = 1;
    }
    for(int i = 1; i < 10000; i++){
        for(int j = 0; j <= 10000; j++){
            dp[i+1][j] = 0;
            if( j >= i ) dp[i+1][j] += dp[i][j-i];
            if( j > i ) dp[i+1][j] += dp[i+1][j-i-1];
        }
    }
}

int main(){
    set();
    while(true){
        cin >> n >> s;
        if(n == 0 && s == 0) break;
        cout << dp[n][s] << endl;
    }
    return 0;
}