Linked Questions

15 votes
27 answers
2k views

Prime or highest factor

Challenge: Given an array of non-negative whole numbers numbers in the range of 0 to Infinity, Check whether all of them are primes or not. (You can take input as ...
user avatar
19 votes
23 answers
2k views

Additive Primes amongst first x Primes

Definition of Additive Primes: Numbers which have exactly 2 divisors are called Prime numbers. Numbers which are prime and their sum of digits is also a prime number are called Additive Primes Task:...
Mr. Xcoder's user avatar
  • 42.4k
26 votes
8 answers
3k views

Create a programming language that only appears to be unusable (Robbers' thread)

See the cop thread for more information. Each answer to this question should crack an answer there. That is to say, it should be code to find the third-largest integer in the input when run in the ...
feersum's user avatar
  • 31.3k
31 votes
14 answers
2k views

Array Escape - get out of there

One day you awake only to find yourself caught in an array. You try to just walk out of there, taking one index at the time, but it seems there are other rules: The array is completely filled with ...
Michael Kunst's user avatar
22 votes
16 answers
3k views

​Cuban​ ​Primes

Given a natural number \$n\$, return the \$n\$-th cuban prime. Cuban Primes A cuban prime is a prime number of the form $$p = \frac{x^3-y^3}{x-y}$$ where \$y>0\$ and \$x = 1+y\$ or \$x = 2+y\$ ...
flawr's user avatar
  • 43.8k
18 votes
21 answers
997 views

Print the missing primes

The Task Write a program or function that, when passed a numerical input x, prints or returns the primes beneath the square root of ...
Addison Crump's user avatar
36 votes
11 answers
3k views

Encode an integer

Given positive integer n > 2. We convert it to an array as follows: If it is equal to 2 return an empty array Otherwise ...
user avatar
1 vote
52 answers
2k views

Is it a completely even number?

A completely even number is a positive even integer whose divisors (not including 1) are all even. Some completely even numbers are: 2 (divisors: 2, 1) 4 (divisors: 4, 2, 1) 16 (divisors: 16, 8, 4, 2,...
MD XF's user avatar
  • 13.8k
17 votes
22 answers
1k views

Greatest Number in a Range When The Sum of Squares of its Prime Factors are Subtracted

The formula Take for instance the number 300 The prime factors of 300 are [2, 3, 5] (unique numbers that are factors of 300 and prime) Squaring each of those ...
Keatinge's user avatar
  • 491
15 votes
18 answers
3k views

It almost works (Robbers' Thread)

Cops' Thread Your challenge is to find an uncracked, unsafe cop on the cops thread, and find an input value for which their code does not do as specified by the challenge. You must use values within ...
emanresu A's user avatar
  • 37.3k
15 votes
20 answers
979 views

Print/Output all positive numbers in which every multi-digit substring in its decimal representation is also prime.

Task Your task is to print or output all positive numbers in which every multi-digit substring in its decimal representation is also prime. If the number has at least 2 digits, this would imply that ...
Leaky Nun's user avatar
  • 49.7k
15 votes
16 answers
2k views

The number of ways a number is a sum of consecutive primes

Given an integer greater than 1, output the number of ways it can be expressed as the sum of one or more consecutive primes. Order of summands doesn't matter. A sum can consist of a single number (...
ngm's user avatar
  • 4,304
24 votes
14 answers
2k views

Prime Time Travel

Don't tell anyone, but I've nicked my uncle's time travel machine! My uncle is obsessed with prime numbers, though, and that shows in the machine — he has programmed it so that it can only go to dates ...
Sundar R's user avatar
  • 6,612
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
13 votes
19 answers
981 views

Compute the minimum \$a(n)>a(n-1)\$ such that \$a(1)+a(2)+\dots+a(n)\$ is prime (OEIS A051935)

Background Consider the following sequence (A051935 in OEIS): Start with the term \$2\$. Find the lowest integer \$n\$ greater than \$2\$ such that \$2+n\$ is prime. Find the lowest integer \$n'\$ ...
Mr. Xcoder's user avatar
  • 42.4k

15 30 50 per page