Skip to main content

All Questions

Tagged with
3 votes
2 answers
470 views

Get resulting rectangle from two overlapping rectangles

I have a function that creates a rectangle from two rectangles that overlap, I was wondering if there is a smarter way to do it purely mathematically rather than lots of ...
WDUK's user avatar
  • 247
1 vote
2 answers
968 views

Find coprime numbers less than n

I get the coprime numbers less than n with the following algorithm: ...
A.M's user avatar
  • 119
6 votes
4 answers
612 views

Pascal Triangle calculation with BigIntegers

On a well known programming challenges website(CW) there is a Kyu2 eggs height problem that can be solved utilizing a variation of Pascals Triangles properties. The problem asks to solve ...
Miguel_Ryu's user avatar
4 votes
1 answer
211 views

Rare binary numbers

Rare numbers are the natural numbers in their binary forms in which there aren't two (or more) ones next to each other. Make a program that will give the N. rare number! For example: In case of N =...
Howard Fring's user avatar
7 votes
2 answers
182 views

Sum of the reciprocals of whole numbers adding to one

I have written some code which works out which sums of reciprocals of whole numbers sum to one, e.g: \$\frac 12 +\frac 13 +\frac 16 =1 \$ \$\frac 17 +\frac 18 +\frac 19 + \frac1{10} + \frac1{11}+ \...
user124568's user avatar
5 votes
4 answers
2k views

Project Euler #5 - Lowest common multiple of 1 through 20

This is my code. All comments welcome. Last time run it only took 335 milliseconds: ...
user avatar
1 vote
1 answer
104 views

Is this routine for determining the epsilon of a Double 100% valid?

This algorithm is intended to determine the epsilon of a given double precision number. As numbers increase in value, their accuracy decreases. This algorithm will return the smallest increment / ...
IamIC's user avatar
  • 191