Series from For loop (is there a repository for Integer Sequences?)

Just curious about the println(str( ));

I started to try to include steps in the seqIntsRepeatedNTimesEach() code:
Result should be 3 3 3 5 5 5 7 7 7
Is it nearly there???

int[] testsequence;

// first argument is number of repetitions of each int number
// second argument is lo
// third argument is hi
// fourth parameter is step
void setup() {
  testsequence = each_repeated(3, 3, 7, 2);

  for (int j = 0; j < testsequence.length; j++) {
    print(testsequence[j], " ");
  }


  exit();
}

int[] each_repeated(int n, int lo, int hi, int step) {

  int inc;
  if (step != 0) {
    inc = abs(step);
  } else {
    inc = 1;
  }

  int dir;
  if (lo < hi) {
    dir = 1 * inc;
  } else {
    dir = -1 * inc;
  }

  int qty = abs(hi - lo)/ inc + 1;
  int len = abs(n) * qty;
  
  int seq [ ] = new int[len];

  for (int i = 0; i < len; i++) {
    seq[i] = i / qty * dir + lo;
  }

  return seq;

}