Instantly share code, notes, and snippets.

View keybase.md

Keybase proof

I hereby claim:

  • I am jjuliano on github.
  • I am joelbryan (https://keybase.io/joelbryan) on keybase.
  • I have a public key whose fingerprint is 84BA 318B DD8B E94F 94E5 3A6E E6D7 F776 CE6D E3A7

To claim this, I am signing this object:

View euler-006.rb
#!/usr/bin/env ruby
# By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6th prime is 13.
# What is the 10001st prime number?
# Solution:
primes, remainder = [], []
limit = 10001
rangemax = limit/10
n = 2
View euler-005.rb
#!/usr/bin/env ruby
# The sum of the squares of the first ten natural numbers is,
# 12 + 22 + ... + 102 = 385
# The square of the sum of the first ten natural numbers is,
# (1 + 2 + ... + 10)2 = 552 = 3025
# Hence the difference between the sum of the squares of the first ten natural
# numbers and the square of the sum is 3025 385 = 2640.
# Find the difference between the sum of the squares of the first one hundred natu-
# ral numbers and the square of the sum.
View euler-004.rb
#!/usr/bin/env ruby
# A palindromic number reads the same both ways. The largest palindrome made
# from the product of two 2-digit numbers is 9009 = 91 99. Find the largest palin-
# drome made from the product of two 3-digit numbers.
# Solution:
palindromes = []
(100..999).each do |x|
(100..999).each do |y|
View euler-003.rb
#!/usr/bin/env ruby
# Problem: Find the largest prime factor of a composite number.
# Description: The prime factors of 13195 are 5, 7, 13 and 29.
#
# What is the largest prime factor of the number 600851475143?
# Solution:
number = 600851475143
View euler-002.rb
#!/usr/bin/env ruby
#
# Problem: Find the sum of all the even-valued terms in the Fibonacci sequence which do not exceed four million.
# Description: Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 terms will be:
#
# 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ...
#
# Find the sum of all the even-valued terms in the sequence which do not exceed four million.
#
# Solution:
View euler-001.rb
#!/usr/bin/env ruby
# Problem: Add all the natural numbers below one thousand that are multiples of 3 or 5.
# Description: If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. @ The sum of these multiples is 23.
# Find the sum of all the multiples of 3 or 5 below 1000.
sum = 0
limit = 1000 - 1
View my_application_controller.rb
class MyApplicationController < UIViewController
def viewDidLoad
@data = [
{ icon: 'niftywow',
project: 'NiftyWow',
description: "Oh you just can't imagine.",
logos: ['apple', 'github']
},
{ icon: 'amazingwhizbang',