Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'What's wrong with this code?' topicStudent Support Forum > General > "What's wrong with this code?"

Next Comment >Help | Reply To Topic
Author Comment/Response
Rob
04/17/08 2:01pm

I am trying to get it to print out a list of the number of nonunique prime factors for every number. What is wrong with this:

For [x = 1, x < 25, x++;
J = {}; h = Length[FactorInteger[x]]; k = 0;
For [i = 1, i < h, i++; k = k + Extract[FactorInteger[x], {i, 2}];
Append[J, k]]];
Print[J]

?

Many Thanks in advance,
Rob

URL: ,

Subject (listing for 'What's wrong with this code?')
Author Date Posted
What's wrong with this code? Rob 04/17/08 2:01pm
Re: What's wrong with this code? yehuda ben-s... 04/21/08 09:55am
Re: Re: What's wrong with this code? Rob 04/23/08 00:07am
Re: What's wrong with this code? Xavier 04/21/08 12:20pm
Re: What's wrong with this code? Randy Silvers 04/22/08 04:47am
Re: What's wrong with this code? Peter Pein 05/05/08 09:31am
Next Comment >Help | Reply To Topic