# prime numbers

### Lehmann Primiality Test in R

December 21, 2011 |

After a small frustration with the limitations of R 16-bit intergers. I think i have worked out a solution. The issue was i was implementing a bone-headed solution to the modulo/exponent step. So to recap. The Lehmann primality test is a probabilistic ... [Read more...]

### I may have ventured into the first circle and Virgil Is NOT Here — Lehmann Primality Test in R

December 20, 2011 |

So a post about Lehmann Primality Tests in HackerNews came across my twitter this morning. Seemed like a great quick coding exercise during lunch. Little Did I know…It is wonderfully simple primality test but i think i have hit up against some R quir... [Read more...]

### Ulam Spirals in R and ggplot

November 29, 2011 |

Having seen a twitter post speed by about Ulam Spirals I started to read up.  As the story goes in 1963 Stanislaw Ulam was bored at conference and started scribbling numbers in a spiral. What he discovered was a strange diaginal pattern of Prime Nu... [Read more...]

### Le Monde puzzle [#6]

February 17, 2011 |

A simple challenge in Le Monde this week: find the group of four primes such that any sum of three terms in the group is prime and the overall sum is minimised. Here is a quick exploration by simulation, using the schoolmath package (with its imperfections): A=primes(start=1,end=53)[... [Read more...]

### bug in schoolmath

June 13, 2010 |

Neil Gunther has pointed out on his blog that the prime number decomposition R package schoolmath contains mistakes in the function primes, listing 1 as a prime number but also including decomposable numbers like 133 in its list of prime numbers: __ primes(100,140) [1] 101 107 111 113 123 129 131 137 __ primes(50,140) [1]  [...] [Read more...]

### schoolmath

March 6, 2010 |

In connection with the Le Monde puzzle of last week, I was looking for an R function that would give me the prime factor decomposition of any integer. Such a function exists within the package schoolmath, developped by Joerg Schlarmann and Josef Wienand. It is called prime.factor and it ... [Read more...]