From ca2eb37d10818dbbd4ee2189a16528ff20966998 Mon Sep 17 00:00:00 2001 From: Neil Smith Date: Mon, 27 Mar 2017 16:54:56 +0100 Subject: [PATCH 1/1] Tidyied output --- euler50.ipynb | 89 +++++++++------------------------------------------ 1 file changed, 15 insertions(+), 74 deletions(-) diff --git a/euler50.ipynb b/euler50.ipynb index c2ae98e..fac99d4 100644 --- a/euler50.ipynb +++ b/euler50.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "code", - "execution_count": 12, + "execution_count": 1, "metadata": { "collapsed": false, "scrolled": true @@ -14,7 +14,7 @@ "104743" ] }, - "execution_count": 12, + "execution_count": 1, "metadata": {}, "output_type": "execute_result" } @@ -27,7 +27,7 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": 2, "metadata": { "collapsed": false }, @@ -38,7 +38,7 @@ "[2, 3, 5]" ] }, - "execution_count": 13, + "execution_count": 2, "metadata": {}, "output_type": "execute_result" } @@ -49,7 +49,7 @@ }, { "cell_type": "code", - "execution_count": 17, + "execution_count": 3, "metadata": { "collapsed": false }, @@ -60,7 +60,7 @@ ":prime_slice" ] }, - "execution_count": 17, + "execution_count": 3, "metadata": {}, "output_type": "execute_result" } @@ -73,7 +73,7 @@ }, { "cell_type": "code", - "execution_count": 18, + "execution_count": 4, "metadata": { "collapsed": false }, @@ -84,7 +84,7 @@ ":sum_primes" ] }, - "execution_count": 18, + "execution_count": 4, "metadata": {}, "output_type": "execute_result" } @@ -97,7 +97,7 @@ }, { "cell_type": "code", - "execution_count": 20, + "execution_count": 5, "metadata": { "collapsed": false }, @@ -108,7 +108,7 @@ "[2, 3, 5, 7, 11]" ] }, - "execution_count": 20, + "execution_count": 5, "metadata": {}, "output_type": "execute_result" } @@ -119,7 +119,7 @@ }, { "cell_type": "code", - "execution_count": 19, + "execution_count": 6, "metadata": { "collapsed": false }, @@ -130,7 +130,7 @@ "28" ] }, - "execution_count": 19, + "execution_count": 6, "metadata": {}, "output_type": "execute_result" } @@ -141,78 +141,19 @@ }, { "cell_type": "code", - "execution_count": 30, + "execution_count": 8, "metadata": { "collapsed": false, "scrolled": true }, "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "0 - 2 : 5\n", - "0 - 4 : 17\n", - "0 - 6 : 41\n", - "0 - 12 : 197\n", - "0 - 14 : 281\n", - "0 - 60 : 7699\n", - "0 - 64 : 8893\n", - "0 - 96 : 22039\n", - "0 - 100 : 24133\n", - "0 - 102 : 25237\n", - "0 - 108 : 28697\n", - "0 - 114 : 32353\n", - "0 - 122 : 37561\n", - "0 - 124 : 38921\n", - "0 - 130 : 43201\n", - "0 - 132 : 44683\n", - "0 - 146 : 55837\n", - "0 - 152 : 61027\n", - "0 - 158 : 66463\n", - "0 - 162 : 70241\n", - "0 - 178 : 86453\n", - "0 - 192 : 102001\n", - "0 - 198 : 109147\n", - "0 - 204 : 116533\n", - "0 - 206 : 119069\n", - "0 - 208 : 121631\n", - "0 - 214 : 129419\n", - "0 - 216 : 132059\n", - "0 - 296 : 263171\n", - "0 - 308 : 287137\n", - "0 - 326 : 325019\n", - "0 - 328 : 329401\n", - "0 - 330 : 333821\n", - "0 - 332 : 338279\n", - "0 - 334 : 342761\n", - "0 - 342 : 360979\n", - "0 - 350 : 379667\n", - "0 - 356 : 393961\n", - "0 - 358 : 398771\n", - "0 - 426 : 581921\n", - "0 - 446 : 642869\n", - "0 - 458 : 681257\n", - "0 - 460 : 687767\n", - "0 - 464 : 700897\n", - "0 - 480 : 754573\n", - "0 - 484 : 768373\n", - "0 - 488 : 782263\n", - "0 - 512 : 868151\n", - "0 - 530 : 935507\n", - "0 - 536 : 958577\n", - "2 - 537 : 970219\n", - "2 - 539 : 978037\n", - "3 - 543 : 997651\n" - ] - }, { "data": { "text/plain": [ "[3, 543, 997651]" ] }, - "execution_count": 30, + "execution_count": 8, "metadata": {}, "output_type": "execute_result" } @@ -223,7 +164,7 @@ "start = 0\n", "best_start = 0\n", "best_length = 1\n", - "while primes[start] <= sum_limit\n", + "while $primes[start] <= sum_limit\n", " # puts start\n", " length = 1\n", " sp = sum_primes(start, length)\n", -- 2.34.1