Questions tagged [number]

A competition to solve a particular problem through the usage and manipulation of numbers.

Filter by
Sorted by
Tagged with
7 votes
7 answers

Formatting numbers

Today computers use millions of bytes of memory, and decimal or hexadecimal notations get less and less informative. Most human-readable formatting just display the number with the highest unit ...
Gzorg's user avatar
  • 171
10 votes
2 answers

The Prime Grid Game

I had fun solving this, so I offer this golf challenge. The objective of this golf is to find the largest prime number that can be constructed using the given instructions. You should accept 3x3 ...
st0le's user avatar
  • 2,228
5 votes
4 answers

Amicable number calculator [closed]

Write a program that calculates amicable numbers, starting from [0,0], intil the maximum value for an integer is reached in the language you chose to write it in. Amicable numbers are two different ...
Nate Koppenhaver's user avatar
18 votes
9 answers

Last k digits of Powers of 2

For any integer \$r\$, there exists a power of 2 each of whose last \$r\$ digits are either 1 or 2. Given \$r\$, find the smallest \$x\$ such that \$2^x\bmod{10^r}\$ consists of only 1 or 2. For \$r=...
st0le's user avatar
  • 2,228
10 votes
9 answers

Arbitrary Base Conversion [closed]

Create a routine that takes an array of blocks in one numeric base system, and convert them to an array of blocks in another numeric base system. Both the from and to systems are arbitrary and should ...
ircmaxell's user avatar
  • 919
9 votes
2 answers

Floating point addition, without floats!

Your task is to write a program, in any language, that adds two floating point numbers together WITHOUT using any fractional or floating point maths. Integer maths is allowed. Format The format for ...
Hannesh's user avatar
  • 1,225
5 votes
8 answers

Power modulo golf. [closed]

Write a function f(a,b,c) that calculates a^b (mod c) in less than 10 seconds. a, b < 10^100 c < 10000. examples: ...
Eelvex's user avatar
  • 5,512
14 votes
6 answers

Calculate the last digits of Graham's Number

Graham's number ends in a 7. It is a massive number, in theory requiring more information to store than the size of the universe itself. However it is possible to calculate the last few digits of ...
Thomas O's user avatar
  • 3,348
11 votes
18 answers

Output nearby primes

Write a program which takes an input (which may or may not be prime), and lists the immediate prime following and preceding it. Example input: 1259 Example ...
Thomas O's user avatar
  • 3,348
13 votes
5 answers

Perfect powers in more than one way?

Challenge Your task is to write a program or function which, given a positive integer \$N\$, finds all positive integers less than or equal to \$N\$ that can be expressed as a perfect power in more ...
fR0DDY's user avatar
  • 4,577
3 votes
6 answers

Minimum of last k [closed]

Write a function that takes two arguments: a number k and a list l, and that returns another list ...
Alexandru's user avatar
  • 6,154
6 votes
33 answers

Print largest integer you can with the fewest characters [closed]

Find a way to output a large integer with few characters. Solutions will be scored based on the magnitude of the number and shortness of code. EDIT: Let's impose a time limit of a minute on sensible ...
moinudin's user avatar
  • 12.7k
150 votes
335 answers

Fibonacci function or sequence

The Fibonacci sequence is a sequence of numbers, where every number in the sequence is the sum of the two numbers preceding it. The first two numbers in the sequence are both 1. Here are the first ...
C. K. Young's user avatar
  • 4,947

23 24 25 26