Historians are still debating when the first computer virus really appeared. We do know a few things for certain, however: the first computer, which is generally considered to have been invented by Charles Babbadge, did not have any viruses. By the mid-1970s, Univax 1108 and IBM 360/370 did.
Nevertheless, the idea for computer viruses actually appeared much earlier. Many consider the starting point to be the work of John von Neumann in his studies on self-reproducing mathematical automata, famous in the 1940s. By 1951, Neumann had already proposed methods for demonstrating how to create such automata.
In 1959, the British mathematician Lionel Penrose presented his view on automated self-replication in his Scientific American article 'Self-Reproducing Machines'. Unlike Neumann, Penrose described a simple two dimensional model of this structure which could be activated, multiply, mutate and attack. Shortly after Penrose's article appeared, Frederick G. Stahl reproduced this model in machine code on an IBM 650.
It should be noted that these studies were never intended to providing a basis for the future development of computer viruses. On the contrary, these scientists were striving to perfect this world and make it more suitable for human life. And it was these works that laid the foundation for many later studies on robotics and artificial intelligence.
In 1962, a group of engineers from America's Bell Telephone Laboratories, V. Vyssotsky, G. McIlroy, and Robert Morris, created a game called 'Darwin.' The game consisted of a so-called umpire in the memory of the computer that determined the rules and order of battle between competing programs created by the players. The programs could track and destroy opponents' programs and, more importantly, multiply. The point of the game was to delete your opponent's programs and gain control over the battle field.
The theoretical suppositions of scientists' and the engineers' harmless game were shadowed by the moment when the world realized that the theory of self-multiplying units could be used, equally successfully, for completely different purposes.