Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options not deleted user 45459

The challenge involves mathematics in some central way. Also consider using more specific tags, listed in the tag wiki info.

2 votes

Write a program that makes 2 + 2 = 5

C++ This is similar to some other methods, but I think slightly sneakier because at a glance it looks extremely straightforward. #include "iostream.h" int main() { int TWO = 2 …
Liam's user avatar
  • 3,215
2 votes

Write a program that makes 2 + 2 = 5

Whitespace, (looks like C++) I don't know if this qualifies, but I thought it was fun raw paste data here. online interpreter here. #include<iostream> int main() { …
Liam's user avatar
  • 3,215
6 votes

Residue Number System

GAP Some Background: I will admit that when I created this question, so many months ago, I did not have a method for solving the hard part of this question: determining the correct number of primes to …
Liam's user avatar
  • 3,215
2 votes

Cofactor Matrices

GAP doesn't really have the same tools to deal with matrices that other math oriented languages do. The only thing really used here is the built in determinant operator. …
Liam's user avatar
  • 3,215
27 votes
3 answers
3k views

Residue Number System

In the vein of large number challenges I thought this one might be interesting. In this challenge, we will be using the Residue Number System (RNS) to perform addition, subtraction, and multiplicati …
Liam's user avatar
  • 3,215
2 votes

XOR multiplication

GAP, 368 Bytes For mathematicians, this is multiplication in the polynomial ring F_2[x], identifying polynomials with natural numbers by evaluating at x=2 as a polynomial over Z. Sure, let's do …
Liam's user avatar
  • 3,215
3 votes

Find the nth Fibohexaprime

GAP, 204 Bytes This answer is pretty unremarkable, except that GAP is cool enough to be able to find the next couple fibohexaprimes (and cooler still, it finds these in milliseconds with the given cod …
Liam's user avatar
  • 3,215
11 votes

Calculate the number of primes up to n

Rust, 0.37001 sec (12 June 2016) About 10 times slower than slower than Dennis' C answer, but 10 times faster than his Python entry. This answer is made possible by @Shepmaster and @Veedrac who helped …
74 votes
16 answers
15k views

Calculate the number of primes up to n

π(n) is the number of primes less than or equal to n. Input: a natural number, n. Output: π(n). Scoring: This is a fastest-code challenge. Score will be the sum of times for the score cases. I wi …
Liam's user avatar
  • 3,215