The first, 40, terms of the sequence enumerating the number of permutations of length n with exactly ONE occurrence of the pattern 12345 are [0, 0, 0, 0, 1, 20, 270, 3142, 34291, 364462, 3844051, 40632886, 432715409, 4655417038, 50667480496, 558143676522, 6223527776874, 70228214538096, 801705888742781, 9254554670121572, 107975393459449243, 1272651313142352772, 15145990284267530992, 181921327390401752024, 2204294203019193756081, 26931916294676580632522, 331664083414683809660835, 4115237573761610774167944, 51427842998082968351212669, 647082672533564031147396224, 8194820761765717102618538424, 104425378944988023086001604240, 1338555113497921152983363841294, 17254970357373466865831767651172, 223630526166871177990082603870013, 2913295299411576508946471205275984, 38139779738457688284742653090230438, 501673805088118857076462374551190108, 6628706572240672936805607434321385134, 87966985707305327545130325758598810688] # 40 terms computed. This took, 170366.441, seconds.