Finding all primes from 1 to n
boolean prime [ ] = new boolean [ n + 1 ] ; Arrays . fill ( prime , true ) ; sieve ( n , prime ) ; System . out . println ( " The ▁ prime ▁ triplets " + " ▁ from ▁ 1 ▁ to ▁ " + n + " are ▁ : " ) ; for ( int i = 2 ; i <= n - 6 ; ++ i ) {