Search results

Jump to navigation Jump to search
  • ...er than say 50. Try to find out how many such cases there are in the range 2..3000. goldbachList lb ub = map goldbach $ [even_lb,even_lb+2..ub]
    992 bytes (161 words) - 19:48, 18 January 2014
  • Version 2 of the [[Monad Transformer Library]] introduced some small See "[[Upgrading from MTL 1 to MTL 2]]" for instructions on how
    3 KB (378 words) - 15:19, 6 February 2021
  • mother ms >>= \m -> father m
    4 KB (454 words) - 02:33, 7 January 2022
  • Version 2 of the [[Monad Transformer Library]] introduced some [[Incompatibilities between MTL 1 and MTL 2|incompatibilities]]
    2 KB (374 words) - 00:43, 9 April 2021
  • magic m n = m : (magic n (m+n)) ...<code>(magic 1 1)</code> is just the Fibonacci numbers, namely <code>[1,1,2,3,5,...]</code>, i.e. an infinite list. Now, the person asking wanted to ev
    4 KB (708 words) - 23:10, 19 April 2021
  • [(x, div n x ) | x <- [2..n], mod n x==0]) n [(x, (x, div n x)) | x <- [d..n], mod n x==0]) (2,n)
    4 KB (605 words) - 17:09, 18 July 2022
  • [(i,j) | i <- [1,2], [(1,1),(1,2),(1,3),(1,4),(2,1),(2,2),(2,3),(2,4)]
    5 KB (679 words) - 17:14, 4 February 2023
  • Teacher: Easy. I'll give you the first one: 2. Student: Hey, you're cheating! I'm the one doing all the work here! I'm
    3 KB (445 words) - 15:19, 6 February 2021
  • Just m -> putLine "" ("Success") doc body showmsg t m doc body =
    4 KB (517 words) - 04:59, 26 April 2021
  • problem_21 = sum [m+n | m <- [2..9999], let n = divisorsSum ! m, amicable m n] where amicable m n = m < n && n < 10000 && divisorsSum ! n == m
    8 KB (1,054 words) - 15:53, 11 October 2015
  • a) Write predicates preorder/2 and inorder/2 that construct the preorder and inorder sequence of a given binary tree, re b) Can you use preorder/2 from problem part a) in the reverse direction; i.e. given a preorder sequen
    2 KB (280 words) - 03:43, 10 January 2017
  • * The levels 1,2,3,...,H-1 contain the maximum number of nodes (i.e 2**(i-1) at the level i) ...g property holds: The address of X's left and right successors are 2*A and 2*A+1, respectively, if they exist. This fact can be used to elegantly constr
    9 KB (727 words) - 03:41, 10 January 2017
  • sumOnetoN n = n * (n+1) `div` 2 == [http://projecteuler.net/index.php?section=problems&id=2 Problem 2] ==
    6 KB (881 words) - 02:31, 8 May 2016
  • ...ber if it is larger than '''1''' and no natural number ''n >= 2'' with ''n^2 <= k'' is a divisor of ''k''. However, we don't actually need to check all primesTME = 2 : gaps 3 (join [[p*p,p*p+2*p..] | p <- primes'])
    3 KB (432 words) - 07:06, 11 May 2016
  • == Version 2 == A comprehensive tutorial in five parts is now available for GPipe 2:
    3 KB (460 words) - 15:27, 6 January 2016
  • * <code>return :: Monad m => a -> m a</code>: | <code>:: m a</code>
    6 KB (988 words) - 04:35, 16 March 2021
  • import Data.Map as M (fromList,union, Map()) keys = \c -> myKeys c `M.union` keys def c
    6 KB (615 words) - 23:47, 28 November 2018
  • factors n = filter (\m -> n `mod` m == 0) [2 .. (n - 1)] foldl (+) 0 [1,2,3]
    3 KB (450 words) - 20:07, 19 October 2020
  • How many fractions lie between 1/3 and 1/2 in a sorted set of reduced proper fractions? problem_73 = fareyCount 10000 (1%3,1%2)
    7 KB (972 words) - 02:57, 3 May 2015
  • rands <- forM [0..(l-2)] $ \i -> getRandomR (i, l-1) [6,5,1,7,10,4,9,2,8,3]
    5 KB (743 words) - 13:10, 9 May 2017

View (previous 20 | next 20) (20 | 50 | 100 | 250 | 500)