Re: Problem with recursive function return value

Bill Allombert <[email protected]> Sat, 14 Feb 2026 16:30:45 +0100
Newsgroups gmane.comp.mathematics.pari.user
Message-ID <aZCVJWPyR1L6eAyu@seventeen>
On Sat, Feb 14, 2026 at 03:54:14PM +0100, [email protected] wrote:
> ? A=[1,2;2,3;2,11;3,31];
> ? mo(v)=Mod(v[1],v[2]);
> ? ch(M)=print(M);if(#M==1,mo(A[,1]),chinese(mo(A[,1]),ch(M[,2..#M])));

Did you mix A and M ? 
A is constant so mo(A[,1]) is constant so all you are computing is
chinese(mo(A[,1]),mo(A[,1])) which is mo(A[,1]).

Cheers,
Bill.