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

Well, it’s already giving the output you expected; so it seems correct.
Anyways, here’s my own take on it as repeatedIntSeq():

/**
 * Repeated Int Sequence (v1.0.0)
 * GoToLoop (2024/Aug/23)
 *
 * https://Discourse.Processing.org/t/series-from-for-loop-
 * is-there-a-repository-for-integer-sequences/44970/31
 */

int[] seq3_1_10, seqNeg3_1_10, seq2_5_Neg5, seq3_3_7_2;

void setup() {
  seq3_1_10 = repeatedIntSeq(3, 10);
  seqNeg3_1_10 = repeatedIntSeq(3, -10);
  seq2_5_Neg5 = repeatedIntSeq(-2, 5, -5);
  seq3_3_7_2 = repeatedIntSeq(3, 3, 7, -2);

  println(str(seq3_1_10));
  println();
  println(str(seqNeg3_1_10));
  println();
  println(str(seq2_5_Neg5));
  println();
  println(str(seq3_3_7_2));

  exit();
}

/**
 * Generates a sequence of integers where each integer is repeated a specified
 * number of times.
 *
 * @param n Number of times each integer should be repeated.
 * @param hi Highest integer in the sequence.
 * If positive, the sequence increments; if negative, it decrements.
 *
 * @return An array of integers representing the repeated sequence.
 */
static final int[] repeatedIntSeq(final int n, final int hi) {
  return repeatedIntSeq(n, hi >= 0 ? 1 : -1, hi);
}

/**
 * Generates a sequence of integers where each integer is repeated a specified
 * number of times, with a defined lower and upper limit.
 *
 * @param n Number of times each integer should be repeated.
 * @param lo Lowest integer in the sequence.
 * @param hi Highest integer in the sequence.
 *
 * @return An array of integers representing the repeated sequence.
 */
static final int[] repeatedIntSeq(final int n, final int lo, final int hi) {
  return repeatedIntSeq(n, lo, hi, 1);
}

/**
 * Generates a sequence of integers where each integer is repeated a specified
 * number of times, with defined lower and upper limits and a specified step.
 *
 * @param n Number of times each integer should be repeated.
 * @param lo Lowest integer in the sequence.
 * @param hi Highest integer in the sequence.
 * @param step Increment for generating the sequence. If 0 defaults to 1.
 *
 * @return An array of integers representing the repeated sequence.
 */
static final int[] repeatedIntSeq(
  final int n, final int lo, final int hi, final int step)
{
  final int
    inc = step != 0 ? abs(step) : 1, 
    dir = inc * (lo < hi ? 1 : -1), 
    qty = abs(n), 
    len = (abs(hi - lo) / inc + 1) * qty, 
    seq[] = new int[len];

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

  return seq;
}
1 1 1 2 2 2 3 3 3 4 4 4 5 5 5 6 6 6 7 7 7 8 8 8 9 9 9 10 10 10 -1 -1 -1 -2 -2 -2 -3 -3 -3 -4 -4 -4 -5 -5 -5 -6 -6 -6 -7 -7 -7 -8 -8 -8 -9 -9 -9 -10 -10 -10 5 5 4 4 3 3 2 2 1 1 0 0 -1 -1 -2 -2 -3 -3 -4 -4 -5 -5 3 3 3 5 5 5 7 7 7