# Questions tagged [arithmetic]

Challenges related to elementary arithmetic.

206 questions
Filter by
Sorted by
Tagged with
61k views

### 1, 2, Fizz, 4, Buzz

Introduction In our recent effort to collect catalogues of shortest solutions for standard programming exercises, here is PPCG's first ever vanilla FizzBuzz challenge. If you wish to see other ...
23k views

### Is this even or odd?

Note: There is not been a vanilla parity test challenge yet (There is a C/C++ one but that disallows the ability to use languages other than C/C++, and other non-vanilla ones are mostly closed too), ...
19k views

2k views

### Co-primality and the number pi

Introduction Number theory is full of wonders, in the form of unexpected connections. Here's one of them. Two integers are co-prime if they have no factors in common other than 1. Given a number $N$,...
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 ...
898 views

### Find the repetend of the decimal representation!

In this challenge 2 years ago, we found the period of a unit fraction (1/n where n is a natural number). Now, your task is to write a program/function to find the ...
4k views

### Simple integer operation calculator

Implement a simple integer operation scriptable calculator. Concept The accumulator starts at 0 and has operations performed on it. At the end of the program output the value of the accumulator. ...
3k views

### Find the smallest number bigger than the input whose digital sum is the input

"Digital sum" refers to the sum of all the digits in a number. For example, the digital sum of 1324 is 10, because ...
Consider taking some non-negative integer such as 8675309 and computing the absolute values of the differences between all the pairs of neighboring digits. For $8675309$ we get $|8-6| = 2$, \\$|6-7|...