This challenge is intended to be solved by using, manipulating, accepting as input, or outputting numeric values.

learn more… | top users | synonyms

7
votes
6answers
463 views

Mixed Base Conversion

Background Most people on here should be familiar with several base systems: decimal, binary, hexadecimal, octal. E.g. in the hexadecimal system, the number 1234516 would represent 1*16^4 + 2*16^3 + ...
14
votes
7answers
1k views

Countdown and recycle

Countdown Your goal for this code-golf challenge is to count down and meanwhile recycle numbers. Let me explain. First your application reads a number, either as program argument or using stdin. ...
22
votes
1answer
433 views

Standardise a Phinary Number

Background Most people on here should be familiar with a few integer base systems: decimal, binary, hexadecimal, octal. E.g. in the hexadecimal system, a number abc.de16 would represent a*16^2 + ...
7
votes
4answers
334 views

Generate Eban Numbers

(Continuing on the number sequences code-golf, here is an interesting sequence) Eban Numbers (A006933) are the sequence of numbers whose names (in English) do not contain the letter "e" (i.e., "e" is ...
12
votes
6answers
926 views

Integer Emotions

Write a program or function that "reacts" to a given integer n (input via function parameter/args/stdin) The program doesn't care about negative numbers, likes even, dislikes odd numbers and ...
13
votes
8answers
1k views

Generate Hofstadter's Figure-Figure Sequence

In Gödel, Escher, Bach, Douglas Hofstadter introduces an integer sequence which is commonly referred to as the figure-figure sequence: 2, 4, 5, 6, 8, 9, 10, 11, 13, 14, 15, 16, 17, 19, 20, 21, 22, ...
11
votes
11answers
2k views

What's that number in Shortlex?

Most computers store integers in binary, but output them in decimal. However, decimal is just one representation, we just happen to find it convenient. This challenge is to write some code to output ...
14
votes
15answers
2k views

Generate Ulam Numbers

Given an integer n (where n < 10001) as input, write a program that will output the first n Ulam numbers. An Ulam number is defined as follows: U1 = 1, U2 = 2. For n > 2, Un is the smallest ...
57
votes
13answers
5k views

Sort a list and write some English!

Your boss managed to read the secret hidden message. He didn't end up firing you, though, he just made you a secretary and forbade you from writing code. But you're a programmer. You need to write ...
-5
votes
3answers
143 views

Swap two numbers without using third variable [duplicate]

What are the tricks to swap two numbers without using a third variable. I am aware of the below. Let me know, what other ways we could swap two numbers? x=x+y; y=x-y; x=x-y;
0
votes
1answer
136 views

Write a “Look-and-Say Numbers” generator [duplicate]

There is a sequence of numbers called the "Look-and-Say Numbers". Here is an example of the first 5 terms of the sequence, starting at 1 (with spaces added between the digits): 1 1 1 2 ...
3
votes
1answer
161 views

Calculate the Riemann Zeta Function [closed]

Calculate the Riemann zeta function to the maximum primitive precision in your language (for C-family, that would be double or long double, var in JS, etc.) No need for BigDecimal or the like unless ...
10
votes
7answers
519 views

Molar masses of compounds

Task Write a program that takes in a compound made solely of elements with an atomic number less than or equal to 92 (Uranium), and outputs the molar mass of the compound in grams/mole. Rules and ...
0
votes
5answers
298 views

Implement atoi function [duplicate]

You already know that the atoi function of stdlib.h converts a string to an integer. atoi (copied from here) int atoi (const char * str); Convert string to integer Parses the C-string ...
12
votes
8answers
944 views

Spell out numbers in French

There was a challenge to convert a number to its numeral in English, but that was too straightforward. Given a number 0–100, your task is to output the corresponding numeral in French. The French ...
3
votes
4answers
407 views

Difference of expressions when evaluated in different orders

We all know the standard order of operations for math functions (PEMDAS), but what if we instead evaluated expressions left-to-right? The Challenge Given a string through standard input or through ...
2
votes
1answer
960 views

A Most Excellent Code Golf Adventure

You dudes, the Most Excellent Adventure is a home brew roleplaying game system based on the Bill & Ted Films, plays gnarly air guitar riff. In this game system, when you draw from your dice pool ...
10
votes
37answers
4k views

Return the flipped version of a number

Given a one digit number, return the number "flipped". Imagine it is a seven-segment display, so 2 would be: And when flipped horizontally it would make: Therefore when 2 is entered, the ...
56
votes
41answers
9k views

Largest number in ten bytes of code

Your goal is to print (to the standard output) the largest number possible, using just ten characters of code. You may use any features of your language, except built-in exponentiation functions. ...
2
votes
2answers
478 views

Saying a number in the shortest way

A string of digits (positive integer) can be converted to plain English in various ways. For instance, 115 can be read as "hundredfifteen", "oneonefive", "elevenfive", "twoonesfive". So question's ...
6
votes
21answers
1k views

Missing Odd Numbers

A set of whole numbers (0-) will be given separated by a space. Some numbers will be missing between certain numbers in the set. Your job is to find the missing odd numbers between them. Conditions ...
20
votes
12answers
3k views

Print the Golden Ratio

This was fun! However with only three digits, the fun was over way too soon. This challenge is similar, but we'll keep the fun going. The Challenge Print as many digits of the Golden Ratio φ as ...
4
votes
3answers
236 views

Pack sequences of non-negative integers

Let N be the set of nonnegative integers, i.e. {0, 1, 2, 3, ...}. Let c0(N) be the set of all infinite sequences in N that converge to 0, i.e. { (xn) ∈ NN | xn → 0 as n → ∞}. ...
7
votes
0answers
507 views

X greater than 3 with at least 2 difference between X and Y

I am trying to golf down some C++. Is it possible to make this condition shorter? X > 3 & X - Y > 1 (Apart from removing whitespace, of course.) So, X is at least 4 but X >= Y + 2. X ...
3
votes
3answers
306 views

Find the next subpermutation of base-64 digits

Permutations of a set have a natural order called lexicographic order in which two permutations are compared by comparing the first position at which they differ. For the purposes of this question ...
14
votes
5answers
1k views

Closest fraction

Task: Your program is given a proper, positive simple fraction in the format <numerator>/<denominator>. For this input, it must find two fractions. A fraction that is less than the ...
11
votes
5answers
516 views

Shortest representation of an Underload number

Flavour text The stack-based esolang Underload has some interesting ties to functional programming. One of them is its treatment of the numerical datatype—like the lambda calculus, you ...
5
votes
6answers
462 views

Generate random PESEL number

From Wikipedia: PESEL is the national identification number used in Poland since 1979. It always has 11 digits, identifies just one person and cannot be changed to another one. It has ...
16
votes
1answer
725 views

Android Lock Screen

Intro You are sitting in a board room at the end of a long table. You look around and see Tim Cook, the Apple Board of Directors, the ghost of Steve Jobs, and Jack Donaghy. Apple has called this ...
-3
votes
5answers
231 views

Unique number generator [closed]

CHALLENGE: Write a pattern formula that outputs a 8 digit number, unique to a given input number. For Example: 12982311 for 1 (this means that 12982311 is always returned for number 1) 23919076 ...
88
votes
108answers
19k views

4, 8, 15, 16, 23, 42

4, 8, 15, 16, 23, 42 Write a program that outputs this sequence of numbers infinitely. However, The Numbers must not appear in your source code anywhere. The following is not a valid Java program to ...
36
votes
14answers
9k views

Longest code to add two numbers [closed]

Task: I know we can all add two numbers the short way, using +. Your task is to create the longest code you can to add two input numbers. Rules: All of the code must be on topic (don't fill it ...
2
votes
15answers
520 views

Random number generation, without built-in random number generation libraries [duplicate]

Task: Make a random number generator. The catch is that you can't use any built-in randomness functions. Your random numbers must be anything between 0 and 100, though they do not have to be floating ...
11
votes
23answers
956 views

Calculate all the squares up to x using only addition and subtraction

The goal is to calculate all the squares up to x with addition and subtraction. Rules: The code must be a function which takes the total number of squares to generate, and returns an array ...
20
votes
31answers
3k views

Letters in phone numbers

Problem: You are making a new phone where people can type in specialized phone numbers, for example, 1-800-program, and they would be converted automatically to a usable phone number, like ...
7
votes
13answers
654 views

Convert from base 10 to base 2 without built-in base conversions

Background: You have been given an assignment to convert base 10 numbers to base 2 without using any premade base conversion functions. You can't use any imported libraries either. Problem: ...
-1
votes
9answers
614 views

Build a numerical library without using any primitive data type

The task is to build a numerical library for working with arbitrarily large integers that supports the following operations: addition subtraction multiplication division modulo operation However, ...
0
votes
7answers
208 views

Find all problems that equal an integer [duplicate]

In this challenge, your job is to write a program that allows a user to enter an integer. Then, the program must find all the possible ways of multiplying two numbers to get the user's integer. Rules: ...
6
votes
5answers
392 views

Convert radicals to mixed & entire radicals and to real numbers

Challenge The goal of this challenge is to take a radical and convert it to a reduced and entire radical, and a real number. You do not have to convert it to all 3, however, you will get bonus points ...
65
votes
61answers
13k views

Largest Number Printable

Before opening this I've done a little search and I've found there is a similar question, but it has been closed because it was ambiguous. I hope this won't. So, your goal is to write a program that ...
3
votes
3answers
424 views

Solve Any Motion Physics Problem (Equations Supplied)

Physics Challenge This program should be able to solve for ANY two of the following variables the user wants to solve. s (displacement) v (velocity) u (initial velocity) a (acceleration) t (time) ...
12
votes
5answers
267 views

Hardy–Ramanujan number generalization

1729, known as the Hardy–Ramanujan number, is the smallest positive integer that can be expressed as the sum of two cubes of positive integers in two ways (12^3+1^3=10^3+9^3=1729). Given an integer n ...
3
votes
2answers
117 views

Convert integer to balanced dozenal

Create a function which takes an integer and returns an array of integers representing the number in balanced base twelve. Specifically, the representation should follow these rules regarding 6 & ...
5
votes
4answers
409 views

Cardinal Numbers in Standard American English

Let n be any integer between 1 and 999,999 inclusive. Your challenge is to write a complete program which using stdin or command-line arguments takes in n and outputs the number of times the letter ...
-1
votes
9answers
260 views

Check whether there are more even than odd numbers on any given nested list [closed]

Take any type of nested list(s) containing numbers. Check for how many even/odd numbers are within and output even, same or odd (-1, 0, 1) in some way. Example: [[1,2,3],4,[5,6],[[7,8], 9]] => 5 ...
14
votes
28answers
1k views

Even or odd: three player

It's a three players game, play with one hand. At same time, each player show his hand with 0 to 5 fingers extended. If all player show same kind of (even or odd) number, there is no winner. But ...
4
votes
6answers
380 views

Test if given number is a Reverse Keith?

Slighty inspired by my previous challenge regarding Keith Numbers I want to propose a challenge to create a function that takes an integer and gives back a true or false depending on the number is a ...
7
votes
7answers
731 views

Enumerate all number that are palindromic in at least two of base 2, 8, 10, 16 or 64

Multi palindromic numbers Finding all number for which at least two** representation are palindromic, with more than one** characters, if in decimal, octal, hexadecimal, binary or in base64. ** have ...
4
votes
4answers
867 views

Make a 24 Game Solver

The 24 Game is a card game. On each cards are four interger numbers. For a player, the goal is to use Addition, Subtraction, Multiplication and Division to end up with 24. The goal of this code ...
8
votes
14answers
724 views

Generate a grid of sums

Challenge Generate a 7 by 7 grid, filled with random numbers. However, every other row and column, you must use the sum of the surrounding cells. Here's a small example with a 3 by 3 grid: 2 2 2 2 ...