Skip to content

Calsoft-Pvt-Ltd/Jatin_Assignment4

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Jatin Assignment 4

Assignments Included

This repository contains solutions for multiple Python assignments.


Question 1 - Execute OS Commands in Python

Problem Statement

Write a Python program that executes a list of OS commands and displays the output in the form of a dictionary.

Features

  • Executes multiple shell commands
  • Removes duplicate commands
  • Continues execution even if one command fails
  • Displays:
    • command output
    • error message
    • execution status

Technologies Used

  • Python 3
  • subprocess module

File

  • Q1-Python-execute_commands.txt

Question 2 - Project Euler Problem 58

Problem Statement

Starting with 1 and spiraling anticlockwise, find the side length of the square spiral for which the ratio of primes along both diagonals first falls below 10%.

Features

  • Generates spiral diagonal numbers
  • Checks prime numbers efficiently
  • Calculates ratio of prime numbers
  • Stops when ratio becomes less than 10%

Sample Output

Side Length: 26241

File

  • problem58.py

Question 3 - Project Euler Problem 308

Problem Statement

Implementation of Conway’s FRACTRAN Prime Generating Algorithm using Python.

Features

  • Simulates Conway's FRACTRAN execution
  • Generates prime exponents using powers of 2
  • Displays iteration count and generated primes
  • Uses fraction-based computation

Sample Output

Iteration: 19
Generated value: 2^2

Iteration: 69
Generated value: 2^3

Iteration: 281
Generated value: 2^5

Known Project Euler Result

The number of iterations required to generate:

2^104743

(where 104743 is the 10001st prime number)

is:

127093784615867

File

  • problem308.py

Technologies Used

  • Python 3

Author

Jatin Pal

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages