This computes a fake geometric progression, that is a sequence that is geometric up to the n-th term, which is , thus showing that precautions should be taken when computing the ratio to prove that a given sequence is geometric.
Here you can set the initial term, the common ratio and the problematic term. P is the Lagrange interpolation polynomial of the first n terms, so the problematic sequence cna be defined as .