Help me understand pins 50 and 39 on Mega board 2560 please

I wrote some simple code to make pins 2 to 54 outputs and turn them on and off in order. Then I wired 52 LEDs ... all of them seem to be doing what I want except pin 50 and 39 turn on and off many times when they ought to be off. Can you help me understand this? I am guessing it has to do with the hardware on the 2560 ...
Here is my code:

void setup() {
 for(int i =2; i<54; i =i+1){
  pinMode(i,OUTPUT);
 }
}
void loop() {
   for(int i =2; i<54; i =i+1){
  digitalWrite(i,1);delay(50);
  digitalWrite(i,0);delay(50);
 }
}

Welcome to the Arduino Forum alawrence.
It looks like Pin 39 is the 70th pin on the microchip, called PG2 (ALE)
52th pin is SCK. so never wire to that except a hardware requires SCK. Called SCKPOINT1 (PB1) and the 20th pin on the microchip.

Thanks!