You need to properly tell the compiler to read the data from PROGMEM
analogWrite(5, pgm_read_byte(&pattern[v]));