Generating a sequence

Hello,

I'm trying to generate this sequence: 0, 1, 3, 6, 10, 10, 11, 13, 16, 16, 17, 19, 19....

I generated the first 5 numbers using the following code, but I have no idea how to generate the rest of the sequence. Any help is appreciated.

1
2
3
4
5
6
  for (int i = 0; i < 5; i++)
{
  seq = i * (i + i) / 2;
  cout << seq << endl;

}
Do you have any additional information about the origin of that sequence? Do you know how to provide additional values by hand?
Topic archived. No new replies allowed.