My Void setup() is repeating!!

Hi everyone,
I am still a beginner but I was trying out a bigger project when for some reason I ran into a super weird problem that I have not encountered before; the code within my Void setup() is repeating. As you can see down in my program I had a for loop in the setup and I originally thought that was the problem but I took it out and it continued to do the same thing. I know it is repeating because my servo repeats that process and I get a "setup" message in the serial monitor (which I had programmed into the setup part). Here is the code, and the basic idea of the project is to make a monitor that scans back and forth to detect distance using sonar, and then capture those distances on an array as to know when something is in the "room." I need an "original" scan to get all of the distances and store them into an array before it continues to scan back and forth which is why the for loop is in the setup (). Either I missed something super simple or this is way above me, but please help. Thank you in advance!

#include <Servo.h>;
Servo radarTurner;
const int degreeJump = 3;
const int triggerPin = 3;
const int echoPin = 5;
const int startAngle = 70;
const int endAngle = 120;
int distanceArray[((endAngle - startAngle) / degreeJump)];

int returnDistance(int servoAngle) {
  radarTurner.write(servoAngle);
  delay(400);
  digitalWrite(triggerPin, LOW);
  delayMicroseconds(2);
  digitalWrite(triggerPin, HIGH);
  delayMicroseconds(5);
  digitalWrite(triggerPin, LOW);
  int duration = pulseIn(echoPin, HIGH);
  int distance = duration * 0.034/2;
  Serial.println(distance);
  return distance;
  
}
  


void setup() {
  radarTurner.attach(9);
  Serial.begin(9600);
  pinMode(6, OUTPUT);
  pinMode(triggerPin, OUTPUT);
  pinMode(echoPin, INPUT);
  radarTurner.write(startAngle);
  for(int i = startAngle; i <= endAngle; i += degreeJump) { 
    distanceArray[((i - startAngle) / degreeJump)] = returnDistance(i);
    //Serial.println(distanceArray[((i - startAngle) / degreeJump)]);
    
  }
  
}

void loop() {
  const int bufferZone = 5;
     for(int i = endAngle; i >= startAngle; i -= degreeJump) {
     distanceArray[((i - startAngle) / degreeJump)] = returnDistance(i);
     //Serial.write(distanceArray[((i - startAngle) / degreeJump)]);
      if(returnDistance(i) < (distanceArray[((i - startAngle) / degreeJump)] - bufferZone)){
        digitalWrite(6, HIGH);
        delay(6000);
        digitalWrite(6, LOW);
        //break; 
      }
  
    }  
    for(int i = startAngle; i <= endAngle; i -= degreeJump) {
     distanceArray[((i - startAngle) / degreeJump)] = returnDistance(i);
     //Serial.write(distanceArray[((i - startAngle) / degreeJump)]);
      if(returnDistance(i) < (distanceArray[((i - startAngle) / degreeJump)] - bufferZone)){
        digitalWrite(6, HIGH);
        delay(6000);
        digitalWrite(6, LOW);
        //break;
      }
    }   
}

Maybe it's just the for loop repeating not void setup(). Check the for loop once..Make sure you have not entered a condition where it cannot be satisfied ever ( infinite loop ).

(deleted)

Thank you for your advice! I am not powering the Arduino with an external source and I am not sure what in the for loop would cause this problem, also I have put some Serial.print's in before the for loop to see if the loop was repeating or the setup was and the entire setup was the one repeating, do you have any other ideas of what the problem would be?

int distanceArray[((endAngle - startAngle) / degreeJump)];

With the values from your code, that gives you an array with (120 - 70) / 3 elements, which is 16 (the fraction gets truncated).
You cannot later address element 16 using that same equation, because the array elements are numbered 0 through 15.

Power supply and wiring.

If setup() appears to repeat, this means the chip is constantly reseting. This is almost always due to
insufficient power or a nearby source of transient interference (like an inductor without a free-wheel diode)

95% or more of problems people have with servos is inadequate power supply. Servos need loads of power,
you can't get away with skimping on this.

Never power a servo from the +5V Arduino pin, BTW, that's potentially risking damaging it.

Which servo are you using? What's its stall current? What's the max current of your power supply?
Even small servos may need over 1A.

int distanceArray[((endAngle - startAngle) / degreeJump)];

This code declares an array with 16 elements. Array elements are accessed beginning with 0, so the elements are numbered 0 through 15.

  for (int i = startAngle; i <= endAngle; i += degreeJump) {
    distanceArray[((i - startAngle) / degreeJump)] = returnDistance(i);
    //Serial.println(distanceArray[((i - startAngle) / degreeJump)]);
  }
  // when i = endAngle, the equation is:
  //  ((i - startAngle) / degreeJump)
  //  ((120 - 70) / 3)
  //  ((50) / 3)
  //  (16.667)  
  //  (16) because integer math drops the fractional part

When i = endAngle, this code writes to distanceArray[16], which does not exist. Whatever is stored immediately after distanceArray is being overwritten and in your case causing the code to repeat setup().

You need to add 1 more element to the array:

int distanceArray[((endAngle - startAngle) / degreeJump) + 1];

Also, #include statements should not have a semicolon at the end, although the compiler ignores the semicolon and only generates a warning message.

#include <Servo.h>;