0
$\begingroup$

I am trying to come up with an equation that describes groups of three. I have one limitation though, which is that I have to use an ever increasing value of n + 1 for each iteration. Not sure if this is possible.

So for example:

when n = x : result y  n = 1 : 1  (first set of three) n = 2 : 2 n = 3 : 3  ................................  n = 4 : 7  (second set of three) n = 5 : 8 n = 6 : 9    ................................ n = 7 : 13  (continues...) 

The limitation is for a computer program that selects rows. I can provide it with an equation that consists of one variable, n. I would really appreciate not just an answer, but a short explanation of how to tackle it.

  • 0
    @RossMillikan - yes, that is exactly it. Sorry if it wasn't clear.2011-11-16

1 Answers 1

4

Do you want to skip three between groups? The first group would be 1,2,3, skip 4,5,6, second group 7,8,9, skip 10,11,12, third group 13,14,15 and so on? If so you have $3\lfloor\frac{n-1}{3}\rfloor+n$

  • 0
    @mrtsherman: To find this, I thought about needing a jump of 3 when n was 1 more than a multiple of 3.2011-11-16