I assume each term does not include the first term 1, otherwise there could be no GP since all terms would be zero.
AP: terms are 1, 1+p, 1+2p, 1+3p, etc.
GP: terms are 1, r, r^2, r^3, etc.
p is the common difference in the AP and r the common ratio in the GP.
x=1+p and y=1+2p, so p=y-x. x-1=r and y-1=r^2. Since p=y-x and p=x-1, y-x=x-1 and y=2x-1.
y-1=(x-1)^2 because r=x-1, so y=x^2-2x+2=2x-1. Therefore x^2-4x+3=0 and (x-3)(x-1)=0, making x=1 or 3, and making y=1 and r=p=0; or y=5 and r=p=2. The AP cannot have a zero common difference, and the GP cannot have a zero common ratio, so we accept the set of values x=3, y=5 and r=p=2. The AP becomes 1, 3, 5, 7, etc., and the GP becomes 1, 2, 4, 8, etc.
The nth term of the AP is 2n-1 and of the GP 2^(n-1).