Linked Questions

26 votes
7 answers
2k views

Recognize most smaller primes with a regex

This time, you are working on a regex. Your regex is meant to approximately full-match the base-10 representations of primes \$0 \le p < 1000\$, while ignoring any non-numeric string or composite ...
AndrewTheCodegolfer's user avatar
87 votes
6 answers
42k views

Hard code golf: Regex for divisibility by 7

Matthias Goergens has a 25,604-character (down from the original 63,993-character) regex to match numbers divisible by 7, but that includes a lot of fluff: redundant parentheses, distribution (...
Charles's user avatar
  • 2,771
-2 votes
6 answers
365 views

Primes, as efficiently inefficient as possible [duplicate]

Write a program that tests if a number n is prime by checking that none of the integers between 2 and ...
Arcturus's user avatar
  • 7,387
25 votes
5 answers
1k views

Parse a two-dimensional syntax

Background Alice and Bob are creating a golfing language to win every single PPCG challenge. Alice wants to make a two-dimensional language, like ><>, but Bob prefers a prefix-infix syntax like in ...
Zgarb's user avatar
  • 42.7k
12 votes
5 answers
894 views

Crazy Librarian's Interesting Prime Permutation Index Number Generator

You saved the day with your prime sequence code, and the math teacher loved it. So much so that a new challenge was posed to the librarian (a/k/a, your boss). Congratulations, you get to code the ...
AdmBorkBork's user avatar
  • 43.4k
-4 votes
5 answers
212 views

Prime decimal representations of prime binary numbers [duplicate]

Problem Statement: Consider a number n in base-10. Find the smallest base-10 integer i greater than ...
user192361237's user avatar
30 votes
4 answers
3k views

Orientation Oriented Programming

Write a program for a specific language that in different orientations performs different tasks. Your code should have at least two non-empty lines and at least two non-empty columns and should ...
Dom Hastings's user avatar
  • 23.9k
15 votes
4 answers
433 views

Counting Abelian groups of a given size

Background Last time, we counted groups of a given size, which is a non-trivial problem. This time, we'll only count Abelian groups, i.e., groups with a commutative operation. Formally, a group (G, ∗) ...
Dennis's user avatar
  • 210k
14 votes
4 answers
606 views

The Most Wanted Prime Numbers

Output a sequence of all the primes that are of the following form: 123...91011...(n-1)n(n-1)..11109...321. That is, ascending decimal numbers up to some ...
AnttiP's user avatar
  • 7,898
38 votes
3 answers
1k views

Build a golfing language with me

A lot of PPCG users helped with the creation of this challenge, both in chat and the Sandbox, specifically Martin Ender, AdmBorkBork, Emigna and user202729 Our community has found it necessary to ...
caird coinheringaahin g's user avatar
27 votes
3 answers
3k views

A regex to match three consecutive integers iff the third integer is the sum of the first two

Write a regular expression which matches a given string consisting of three non-negative, space-separated integers if and only if the last integer is the sum of the previous two. Answers may be for ...
Josh Withee's user avatar
24 votes
3 answers
527 views

Peel the potato

This is a potato: @@ @@@@ @@@@@@ @@@@@@ @@@@ @@ More generally, a size N potato is defined as the following shape: If N is even, it is 2 centered ...
VarmirGadkin's user avatar
9 votes
3 answers
2k views

GolfScript, CJam, or Pyth? [duplicate]

Which language usually produces shorter golfed code: Pyth, CJam or Golfscript? In asking this, I do not mean which has a prettier syntax or which has the most useful commands, I mean overall, which ...
Nico A's user avatar
  • 2,530
31 votes
1 answer
805 views

Unrestricted Languages

One of my favorite types of challenges on this site are restricted-source challenges. These challenges impose a computer tractable restriction that the sources of potential answers must pass. I like ...
Wheat Wizard's user avatar
  • 98.8k
1 vote
0 answers
138 views

Output the happy primes [duplicate]

Input: n Output: A list of length n, with each element being the nth happy prime. Starting with any positive integer, replace the number by the sum of the squares of its digits, and repeat the ...
Matt's user avatar
  • 111

15 30 50 per page
1
2 3 4 5 6