The article presents an algorithm to compute a C[t]-module basis G for a given subalgebra A over a polynomial ring R=C[x] with a Euclidean domain C as the domain of coefficients and t a given element of A. The reduction modulo G allows a subalgebra membership test. The algorithm also works for more general rings R, in particular for a ring R⊂C((q)) with the property that f∈R is zero if and only if the order of f is positive. As an application, we algorithmically derive an explicit identity (in terms of quotients of Dedekind η-functions and Klein's j-invariant) that shows that p(11n+6) is divisible by 11 for every natural number n where p(n) denotes the number of partitions of n.