I am trying to generate a random even number, and then try to write the list of primes that are composing it as Goldbach conjecture says.
It's just a test to learn how to use mathematica, so I would really appreciate comments.
I tried this:
f[i_]:=f[i]=Table[{i,1,100},i];
Generate an invisible table of integers up to 100. My teacher says you have to generate a list first to work with it.
a = If[f[i], Divisible[i,2],Print[i],Print[i+1]]
Here I attempted to print out only if the randomly generated integer was even.
DeleteCases[IntegerPartitions[a], If[a = PrimeQ, Print[a],]
Here I meant to tell Mathematica to sort out all the possibilities where a is composed of two primes, if not just do not print a
.
This doesn't work of course. I tried to google the problem but I don't find something close enough.
Can you please help with that?
Range[2,100,2]
for your first step. $\endgroup$