I've been working on a simple prime factorization program, and need a little help. Here's the code:

` ``ClrHome Input "N=",N ClrList |LT N->|LT(1) ClrList |LP While dim(|LT)!=0 ClrList |LG |LT(1)->L For(F,2,iPart(L/2 If fPart(L/F)=0 F->|LG(dim(|LG)+1 End If dim(|LG)=0 Then L->|LP(dim(|LP)+1 Else augment(|LT,|LG)->|LT End If dim(|LT)=1 ClrList |LT If dim(|LT)>1 DeltaList(cumSum(|LT))->|LT End`

Program Link: http://sc.cemetech.net/?hash=lBlpVuEOXDBU/Kz/d+7+HCmUnNBx

My issue is that the output list, |LP, *contains* all the right values, but not always the right *amount*. For example, N=9 produces {3}, N=16 produces {2 2 2 2}, and N=100 produces {2 5 2 2 5 2 5 5 2 5 2 2 5 2 5 5}.

Anyone know what's going on? Any help would be well appreciated.

Thanks!