Questions tagged [number-theory]

Number theory involves properties and relationships of numbers, primarily positive integers.

393 questions
Filter by
Sorted by
Tagged with
2k views

Restricted-source, take this!

a.k.a. You Can Output Anything With Labyrinth Or Hexagony™ Challenge In a recent restricted-source challenge, I could print any character with only half of the allowed digits with very small character ...
1k views

3k views

Narcissistic loop lengths

A narcissistic number is a natural number which is equal to the sum of its digits when each digit is taken to the power of the number digits. For example $8208 = 8^4 + 2^4 + 0^4 + 8^4$, so is ...
526 views

Repetend length in 1/n

This problem is based on non-terminating, repeating decimal points. Let $n$ be any positive integer $(n > 1 \text{ and } n < 10000)$, say $7$. Then, $1/n = 1/7 = 0.142857142857142857...$ ...
1k views

Count the Collatz survivors mod 2^n

Introduction We have 22 Collatz conjecture-related challenges as of October 2020, but none of which cares about the restrictions on counter-examples, if any exists, to the conjecture. Considering a ...
2k views

Find a divisibility pattern

Background Sometimes when I'm golfing a program, I'm presented with the following situation: I have an integer value $x$ on some fixed interval $[a, b]$, and I'd like to test whether it's in some ...
501 views

1k views

Find the Inverse Neighbor Pairs

Definition We say a pair of integers $(a,b)$, where $0<a<b<N$ and $N$ is an integer larger than 4, is an inverse neighbor pair respect to $N$ if $ab\equiv1\text{ }(\text{mod }N)$ ...
383 views

Dirichlet Convolution Inverse

If $f,g\colon \mathbb{Z}_{\geq 1} \to \mathbb{R}$, the Dirichlet convolution of $f$ and $g$ is defined by $\qquad\qquad\qquad \displaystyle (f*g)(n) = \sum_{d|n}f(d)g(n/d).$ This ...
2k views

Longest Prime Sums

Sandbox There are special sets S of primes such that $\sum\limits_{p\in S}\frac1{p-1}=1$. In this challenge, your goal is to find the largest possible set of primes that satisfies this condition. ...
3k views

Who's next to me in the queue?

Problem 4 in the 2019 BMO, Round 1 describes the following setup: There are $2019$ penguins waddling towards their favourite restaurant. As the penguins arrive, they are handed tickets numbered ...
2k views

Next Shared Totient

The totient function $\phi(n)$, also called Euler's totient function, is defined as the number of positive integers $\le n$ that are relatively prime to (i.e., do not contain any factor in common ...
4k views

Fermat's Last Theorem, mod n

Fermat's Last Theorem, mod n It is a well known fact that for all integers $p>2$, there exist no integers $x, y, z>0$ such that $x^p+y^p=z^p$. However, this statement is not true in ...
2k views

Fermat's polygonal number theorem

Fermat's polygonal number theorem states that every positive integer can be expressed as the sum of at most $n$ $n$-gonal numbers. This means that every positive integer can be expressed as the ...
1k views

Dividing Divisive Divisors

Given a positive integer $n$ you can always find a tuple $(k_1,k_2,...,k_m)$ of integers $k_i \geqslant 2$ such that $k_1 \cdot k_2 \cdot ... \cdot k_m = n$ and k_1 | k_2 \text{ , } k_2 | ...
360 views

Interpreter for number theory, modulo n

A sentence of number theory (for our purposes) is a sequence of the following symbols: 0 and ' (successor) - successor means <...