I have a vague memory of a court case involving a man being prosecuted for publicizing information about nuclear weapons. He obtained that information by logic deduction and probably calculations from all the public knowledge (newspapers, tv, etc). I have not been able to find that case. Does anyone know which is?
You are likely thinking of United States v. The Progressive, Inc., 467 F. Supp. 990 (W.D. Wis. 1979) and the related injunction against a letter by Charles R. Hansen. However, these were not prosecutions; they were applications by the United States for injunctions to prevent the publication of the material.
The allegation relating to The Progressive was that an article due to be published would be in violation of the "born secret" clause of the Atomic Energy Act of 1954 (codified at 42 U.S.C. 2011 and following). The author was journalist Howard Morland.
That act declares as restricted (see 42 U.S.C. 2014):
all data concerning (1) design, manufacture, or utilization of atomic weapons; (2) the production of special nuclear material; or (3) the use of special nuclear material in the production of energy, but shall not include data declassified or removed from the Restricted Data category pursuant to section 2162 of this title.
The U.S. argued:
that its national security interest also permits it to impress classification and censorship upon information originating in the public domain, if when drawn together, synthesized and collated, such information acquires the character of presenting immediate, direct and irreparable harm to the interests of the United States.
It is not universally accepted that the information was actually gleaned wholly from public knowledge, but that would not have made a difference to the government's position on the injunction.
There was a related letter by Charles R. Hansen, containing instructions for a hydrogen bomb, that was also enjoined by the United States against being published in the Daily Californian. This was eventually the one actually first published, and is known colloquially as "the Hansen Letter."
Ultimately, after the Hansen letter was published in The Press Connection and the Chicago Tribune (two publications not enjoined by court order), the government withdrew its request to prevent the publication, and the other publications went forward.
As Jen said, there were no prosecutions but during the Manhattan Project, there were several investigations of possible leaks that discussed things remotely close to the actual work being conducted. One notable incident a cartoonist named Alvin Schwartz came under investigation of having received nuclear secrets from the Manhattan project employees after he penned and published a Superman story for the daily newspaper strip that use of the term "cyclotron." At the time, cyclotrons were real devices that were used (and still used) to separate fissile material from non-fissile material. The investigation was halted after Shwartz explained that he first read the term in a "Popular Mechanics" article that was published over a decade prior to his own use of the term.
It's important to note that any time classified tech is described accurately in fiction or public articles, the authors are typically investigated to identify the leaker who gave them the secrets. Tom Clancy was once investigated for describing near perfectly the working mechanics of some tech that allowed U.S. Submarines to run quietly. Turns out no one told Clancy, he had just read publicly available info and made an educated guess about what was going on and turned out to be incredibly accurate. In training to handle classified material, this is something that those holding a clearance of any type are trained to be aware of. Two documents that are not classified may, in combination, reveal classified info. For example, one document that reveals Mr. James Bond is an employee at MI6, another document might reveal that Mr. Bond filed for travel expenses to Moscow on February 14th, and a third document that confirms that Agent 007 arrived in Moscow alive and well on the 15th of February. Separately, they might not reveal much, but combined, it can be deduce that Agent 007 and James Bond are one and the same, which could prove bad for Mr. Bond, now that it's open knowledge it's assumed that Russia knows who he is. If he's still in Russia, this could get him arrested or killed. Let's hope Q doesn't leave his schematics lying around.
It should also be noted that, in the U.S. at least, a journalist or other civilian with no access to classified documents is rarely prosecuted for publishing classified info but may be put under intense scrutiny as the assumption is that they are working with an insider to expose secrets. The investigation is usually looking for the source of the leak. In the case of someone who deduced it from publicly available info, this might be useful in determining how to write stuff for the public consumption to prevent it. In the case of an actual source feeding them something they should not know, it could be met with disciplinary action (At the very least, it's a good way to get yourself fired. At the worst, it's a jail sentence.).
While Prior Restraint (Government action that prohibits speech or expression prior to it being made) is allowed in the U.S., it is under very limited circumstances that the publication of such information would "would cause inevitable, direct, and immediate danger to the United States." (Source) As such, it's very rarely granted or enforced in modern U.S. Law.