LI Web Presents...

An Introduction to
Smart Contracts with Ethereum
[Presentation by Nick Selvaggio - Sego Solutions]

02/28/2018

Snap Some Pics

Post to Meetup!

Calling all Volunteers

  • Design & Development
  • Planning & Speaker Recruitment
  • Social and Community
  • Giphy Research & Analytics


CHICKEN!

If you have a few bucks to chip in, great!

If not, also great. Either way, please help yourselves and don't leave me with leftovers =)

Know a company who may want to sponsor food for future talks? Talk to me after

Upcoming LI Web Events

Powered by longisland.codes!

Other Meetups

Powered by longisland.codes!

Introductions

Who you are...Where your from...
Describe your Experience with Ethereum, Smart Contracts, Blockchain, BitCoin or life in general...

Challenge: Even Fib

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, ...

By considering the terms in the Fibonacci sequence whose values do not exceed four million, find the sum of the even-valued terms.

Anyone have a solution
they'd like to share?


//generates a fib sequence who's value is < n;
//adopted from https://gist.github.com/jfairbank/8d36e4bde9c16dc0bac7
function *fibonacci(n) {
	const infinite = !n && n !== 0;
	let current = 0;
	let next = 1;

	while (infinite || current < n) {
		yield current;
		[current, next] = [next, current + next];
	}
}
	
let [...fibseq] = fibonacci(4000000);

//fibseq = (34) [0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 
//4181, 6765, 10946, 17711, 28657, 46368, 75025, 121393, 196418, 317811, 514229, 832040, 
//1346269, 2178309, 3524578]
	
let sum = 0;
	
fibseq.forEach(item => {
	
	if(item % 2 == 0) {
		sum += item;
	}
	
});
	
//sum = 4613732

On with the show...

Nick Selvaggio

Sego Solutions & ADC Medical Devices

LI Drupal Meetup

Stack Starter

All Around Awesome Guy