The p-adic valuation of Lucas sequences