Coder Social home page Coder Social logo

project-euler's Introduction

Project Euler

Stats Python

Basically all my Project Euler relevant codes, mainly in Python. I have put all the current necessary resources on the "resources" folder.

You can also do Project Euler+ by HackerRank here.

Some functions where you can import from

  • check_primes
    • is_prime, checks whether a positive integer is a prime number
    • is_composite, the exact opposite of is_prime
    • sieve, returns a list of all prime numbers up to the input integer
  • check_sequences
    • is_triangle, checks whether an integer is in the form n(n+1)/2
    • is_square, checks whether an integer is in the form n**2
    • is_pentagonal, checks whether an integer is in the form n(3n-1)/2
    • is_hexagonal, checks whether an integer is in the form n(2n-1)
    • is_heptagonal, checks whether an integer is in the form n(5n-3)/2
    • is_octagonal, checks whether an integer is in the form n(3n-2)
  • choose
    • binom, takes two integers n and r, returning nCr
  • number_theory
    • gcd, takes two integer inputs and returns the GCD of both integers
    • lcm, takes two integer inputs and returns the LCM of both integers
    • factorial, returns the factorial of the integer input
    • factor, returns the number of positive factors of the input integer
    • sum_factor, returns the sum of all positive factors of the input integer
    • fib, returns the n-th Fibonacci number, where n is the input
    • congruence, takes three integer inputs a, b, m and solves for x where ax = b mod m
  • palindromes
    • is_palindromic, checks whether an integer or string-ized integer is a palindrome

Noob Notes 🤪

Some problems are solved using sequences (lists, tuples, dictionaries, etc) which is computationally more expensive compared to assigning and modifying a constant number of variables. This is because it was done a very long time ago. For now, I've only decided to improve some, especially the first problems. Maybe more in the future.

project-euler's People

Contributors

russelldash332 avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.