# Questions tagged [arithmetic]

Challenges related to elementary arithmetic.

543 questions
Filter by
Sorted by
Tagged with
232 views

### Square root of a base 10 positive integer, digit by digit [closed]

It is possible (Wikipedia reference) to compute the square root of any number in a digit by digit fashion using a simple (I had learned it in primary school) algorithm. Challenge: read a positive ...
• 113
2k views

### We're much closer than you think

Martin Ender's 2D programming language Alice has two different modes depending on what orientation the IP has: orthogonal (Cardinal mode) or diagonal (Ordinal mode). Commands in Alice change their ...
• 49.8k
4k views

### Shortest "arithmetic" formula to output 1000 primes

Write a formula using only the digits 0-9, +, *, -, <...
1k views

### Concatenations of powers and their squares

At time of writing, my reputation is $16,256$. As I noted in chat, Oh cool my rep is the concatenation of two powers of 2: 16,256 Or even the concatenation of a power of 2 and its square, which is ...
• 49.8k
8k views

### The vanilla factorial challenge

Task Given a non-negative integer $n$, evaluate the factorial $n!$. The factorial is defined as follows: $$n!=\begin{cases}1 & n=0\\n\times(n-1)!&n>0\end{cases}$$ Rules All default I/...
• 75.1k
792 views

• 40.5k
9k views

### Machine Learning Golf: Multiplication

I'd like to propose a different kind of golfing challenge to this community: (Artificial) Neural Networks are very popular machine learning models that can be designed and trained to approximate any ...
1k views

### Subtract the Folded Matrix

Challenge: Given an NxN matrix where $N\geq2$ and one of eight distinct 'folding options', output a 2D array/list with the subtracted values. The eight folding options are: left-to-right; right-to-...
• 125k
338 views

### Probabilistic approach puzzle

A few hours earlier, I got this puzzle: Suppose, you toss a coin n times, then what is the probability of getting m number of heads? ( where m belongs to the set of all prime numbers) For instance,...
• 2,980
7k views

### Multiplicative persistence

Multiplicative Persistence Multiply all the digits in a number Repeat until you have a single digit left As explained by Numberphile: Numberphile "What's special about 277777788888899?" ...
• 781
8k views

### Historical difference between / and ÷ in mathematical expressions

Introduction: Inspired by a discussion that is already going on for many years regarding the expression $6÷2(1+2)$. With the expression $6÷2(1+2)$, mathematicians will quickly see that ...
• 125k
1k views

### Spot all (anti)diagonals with duplicated values

Challenge: Given a matrix input, determine the amount of diagonals and anti-diagonals with duplicated numbers. So if we have a matrix like this: ...
• 125k
1 vote
246 views

### Work out $x^y$ using only addition and subtraction [duplicate]

The challenge is to implement a function or program that takes two numbers, $x$ and $y$ and return the result of $x^y$. The program cannot use any other mathematical operation other than $+$ ...
• 151
214 views

### All the digisibles [duplicate]

A natural number (written in the decimal base) is qualified as digisible if and only if it fulfills the following 3 conditions: none of its digits is zero, all the digits that compose it are ...
• 2,862
1k views

### Standardize the Samples (Compute the z-Score)

Given a list of floating point numbers, standardize it. Details A list $x_1,x_2,\ldots,x_n$ is standardized if the mean of all values is 0, and the standard deviation is 1. One way to compute this ...
• 43.8k
3k views

### How much candy can you eat?

Credit to Geobits in TNB for the idea A post without sufficient detail recently posited an interesting game: 2 children sit in front of an array of candy. Each piece of candy is numbered 1 to ...
• 11.6k
171 views

### Measuring Mountains [duplicate]

Sum-It is a language I created (quite late) for the Language Design Contest in TNB, for which the theme was "Range". Naturally I interpreted this as "Mountain Range" and created a language about ...
• 11.6k
2k views

• 2,862