A quantity P varies partly as n and partly as the square of n. When P =-3,n=-1 and when P = 18,n=2.Find P when n=1.