Skip to content

Instantly share code, notes, and snippets.

@jakedobkin
jakedobkin / myfirstjavascript.html
Created November 10, 2011 17:21
My First Javascript (Euler Problem 1)
<html>
<body>
<script type="text/javascript">
t= 0;
for (i=0;i<1000;i++)
{
m = i%3;
n = i%5;
@jakedobkin
jakedobkin / euleur2.html
Created November 10, 2011 19:34
Euler Problem 2
<html>
<body>
<script type="text/javascript">
a = 1;
b = 1;
c = 0;
d = 0;
for (i=0;i<=30;i++)
@jakedobkin
jakedobkin / euler2a.html
Created November 10, 2011 19:35
Euler Problem 2a
<html>
<body>
<script type="text/javascript">
a = 1;
b = 1;
c = 0;
d = 0;
for (i=0;i<=30;i++)
@jakedobkin
jakedobkin / euler3.html
Created November 10, 2011 22:47
Euler Problem 3
<html>
<body>
<script type="text/javascript">
c = 600851475143;
for (i=3;i<=775146;i++)
{
if (c%i == 0){
@jakedobkin
jakedobkin / gist:1358798
Created November 11, 2011 18:32
Euler Problem 4
<html>
<body>
<script type="text/javascript">
total = 0;
for (i=100;i<=999;i++)
{
for (j=100;j<=999;j++)
{
@jakedobkin
jakedobkin / gist:1359093
Created November 11, 2011 20:13
Euler Problem 5
<html>
<body>
<script type="text/javascript">
isdiv = false;
i=1;
while (isdiv == false)
{
if (i%1 == 0 && i%2 == 0 && i%3 == 0 && i%4 == 0 && i%5 ==0 && i%6 == 0 && i%7 == 0 && i%8 == 0 && i%9 == 0 && i%10 == 0 && i%11 == 0 && i%12 == 0 && i%13 == 0 && i%14 == 0 && i%15 == 0 && i%16 == 0 && i%17 == 0 && i%18 == 0 && i%19 == 0 && i%20 == 0)
@jakedobkin
jakedobkin / gist:1360817
Created November 12, 2011 17:02
Euler 7
<html>
<body>
<script type="text/javascript">
primecount=1;
i=3;
while (primecount < 10001)
{
@jakedobkin
jakedobkin / gist:1360945
Created November 12, 2011 18:52
Euler Problem 8
<html>
<body>
<script type="text/javascript">
ournumber="731671765313306249192251196744265747423553491949349698352031277450632623957831801698480186947885184385861560789112949495459501737958331952853208805511125406987471585238630507156932909632952274430435576689664895044524452316173185640309871112172238311362229893423380308135336276614282806444486645238749303589072962904915604407723907138105158593079608667017242712188399879790879227492190169972088809377665727333001053367881220235421809751254540594752243525849077116705560136048395864467063244157221553975369781797784617406495514929086256932197846862248283972241375657056057490261407972968652414535100474821663704844031998900088952434506585412275886668811642717147992444292823086346567481391912316282458617866458359124566529476545682848912883142607690042242190226710556263211111093705442175069416589604080719840385096245544436298123098787992724428490918884580156166097919133875499200524063689912560717606058861164671094050775410022569831552000559357297257163626956188267
@jakedobkin
jakedobkin / gist:1361162
Created November 12, 2011 21:43
euler 9
<html>
<body>
<script type="text/javascript">
for (a=1;a<=1000;a++)
{
for (b=a+1;b<=1000;b++)
{
c = Math.sqrt(Math.pow(a,2) + Math.pow(b,2));
sum = a+b+c;
#!/usr/local/bin/node
//NOW WITH NODE.JS
n=2000000;
sumPrimes=0;
myPrimes = new Array();
// set all array values to true