# Questions tagged [number-theory]

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

431 questions
Filter by
Sorted by
Tagged with
299 views

### Help me design an unfair laundry machine

There's a payment machine for laundry in my building which does a few frustrating things. The ones relevant to this challenge are: It doesn't make change. So if you pay over the amount then you are ...
1 vote
330 views

3k views

219 views

### Multiplicity of Shared Totients

Euler's totient function, $\varphi(n)$, counts the number of integers $1 \le k \le n$ such that $\gcd(k, n) = 1$. For example, $\varphi(9) = 6$ as $1,2,4,5,7,8$ are all coprime to $9$. ...
780 views

### AoCG2021 Day 14: Adjusting dancing program's period

Part of Advent of Code Golf 2021 event. See the linked meta post for details. Related to AoC2017 Day 16. I'm using the wording from my Puzzling SE puzzle based on the same AoC challenge instead of the ...
2k views

### Sum powers to n

Each natural number (including 0) can be written as a sum of distinct powers of integers (with a minimum exponent of 2). Your task is to output the smallest power required to represent $n$. For ...
2k views

### AoCG2021 Day 4: Infinite Elves and infinite houses 2

Part of Advent of Code Golf 2021 event. See the linked meta post for details. Related to AoC2015 Day 20, Part 1. Here's why I'm posting instead of Bubbler and why not emanresuA To keep the Elves busy,...
487 views

### How to solve the LCM in 50 bytes of Python

I've recently stumbled upon a Russian site called acmp.ru, in which one of the tasks, HOK, asks us to find the LCM of two positive integers. The full statement, translated to English is as follows: ...
2k views

895 views

### Duplicates in "n × hamming weight of n" sequence

Background The sequence in the title is A245788 "n times the number of 1's in the binary expansion of n" ("times" here means multiplication), which starts like this: ...
1k views

### Non-Hamming numbers

Hamming number (also known as regular number) is a number that evenly divides powers of 60. We already have a task to do something with it. This time we are going to do the opposite. I define non-... 2k views

### How hyperperfect am I?

A $k$-hyperperfect number is a natural number $n \ge 1$ such that $$n = 1 + k(\sigma(n) − n − 1)$$ where $\sigma(n)$ is the sum of the divisors of $n$. Note that $\sigma(n) - n$ is the ...
1k views

### Calculate Home Primes

The Home Prime of an integer $n$ is the value obtained by repeatedly factoring and concatenating $n$'s prime factors (in ascending order, including repeats) until reaching a fixed point (a prime). ...
1k views

### The meeker number sequence

The Meeker numbers are a 7 digit number in form of $abcdefg$, where $a×b=10c+d$ and $d×e=10f+g$. As an example $6742612$ is a meeker number, here $6×7=10×4+2$ and $2×6=10×1+2$, so it is a ...
945 views

### Sociable sequences

Sociable numbers are a generalisation of both perfect and amicable numbers. They are numbers whose proper divisor sums form cycles beginning and ending at the same number. A number is $n$-sociable ...
2k views

### Reconstruct an integer from its prime exponents

All integers $n > 0$ can be expressed in the form $$n = \prod_{\text{prime } p} p^e = 2^{e_2} 3^{e_3} 5^{e_5} 7^{e_7} \cdots$$ This form is also known as it's prime factorisation or prime ...
2k views

### First sequence with no square differences

Consider the sequence $(a_n)$ defined in the following way. $a_0=0$ For all $n=1, 2, 3, \dots$, define $a_n$ to be the smallest positive integer such that $a_n-a_i$ is not a square number, ...
1k views

### Generalise perfect numbers

Let $\sigma(n)$ represent the divisor sum of $n$ and $\sigma^m(n)$ represent the repeated application of the divisor function $m$ times. Perfect numbers are numbers whose divisor sum equals ...
This code-challenge is based on OEIS sequence A261865. $A261865(n)$ is the least integer $k$ such that some multiple of $\sqrt{k}$ is in the interval $(n,n+1)$. The goal of this challenge is ...
Powerful numbers are positive integers such that, when expressed as a prime factorisation: $$a = p_1^{e_1} \times p_2^{e_2} \times p_3^{e_3} \cdots \times p_k^{e_k}$$ all exponents $e_1, e_2, ...$ ...