Prime Numbers Through the Ages: Implementing the Sieve of Eratosthenes in Java

Session

Computer Science and Communication Engineering

Description

The Sieve of Eratosthenes is one of the oldest yet most efficient algorithms for finding prime numbers up to a given limit. This paper presents an analytical and practical implementation of the sieve, focusing on its mathematical foundations and optimized algorithmic behavior using the Java programming language. The aim is to demonstrate how ancient mathematical logic continues to be applicable in modern computational practices. The study outlines the basic sieve method, explores three critical optimizations that reduce time complexity, and evaluates the algorithm's performance in different scenarios. Moreover, this work contrasts the classical approach with similar prime-finding algorithms and emphasizes its didactic value in both education and practical programming. By translating historical mathematical insight into executable code, the paper illustrates the enduring relevance of classical thought in contemporary problem-solving contexts.

Keywords:

Sieve of Eratosthenes, prime numbers, algorithm optimization, time complexity, Java implementation etc

Proceedings Editor

Edmond Hajrizi

ISBN

978-9951-982-41-2

Location

UBT Lipjan, Kosovo

Start Date

25-10-2025 9:00 AM

End Date

26-10-2025 6:00 PM

DOI

10.33107/ubt-ic.2025.113

This document is currently not available here.

Share

COinS
 
Oct 25th, 9:00 AM Oct 26th, 6:00 PM

Prime Numbers Through the Ages: Implementing the Sieve of Eratosthenes in Java

UBT Lipjan, Kosovo

The Sieve of Eratosthenes is one of the oldest yet most efficient algorithms for finding prime numbers up to a given limit. This paper presents an analytical and practical implementation of the sieve, focusing on its mathematical foundations and optimized algorithmic behavior using the Java programming language. The aim is to demonstrate how ancient mathematical logic continues to be applicable in modern computational practices. The study outlines the basic sieve method, explores three critical optimizations that reduce time complexity, and evaluates the algorithm's performance in different scenarios. Moreover, this work contrasts the classical approach with similar prime-finding algorithms and emphasizes its didactic value in both education and practical programming. By translating historical mathematical insight into executable code, the paper illustrates the enduring relevance of classical thought in contemporary problem-solving contexts.