# Thabit number

In number theory, a Thabit number, Thâbit ibn Qurra number, or 321 number is an integer of the form $3\cdot 2^{n}-1$ for a non-negative integer n.
The first few Thabit numbers are:
    2, 5, 11, 23, 47, 95, 191, 383, 767, 1535, 3071, 6143, 12287, 24575, 49151, 98303, 196607, 393215, 786431, 1572863, ... (sequence A055010 in the OEIS)
The 9th century mathematician, physician, astronomer and translator Thābit ibn Qurra is credited as the first to study these numbers and their relation to amicable numbers.

## Properties

The binary representation of the Thabit number 3·2$^n$−1 is n+2 digits long, consisting of "10" followed by n 1s.
The first few Thabit numbers that are prime (Thabit primes or 321 primes):
    2, 5, 11, 23, 47, 191, 383, 6143, 786431, 51539607551, 824633720831, ... (sequence A007505 in the OEIS)
As of October 2023, there are 68 known prime Thabit numbers. Their n values are:
    0, 1, 2, 3, 4, 6, 7, 11, 18, 34, 38, 43, 55, 64, 76, 94, 103, 143, 206, 216, 306, 324, 391, 458, 470, 827, 1274, 3276, 4204, 5134, 7559, 12676, 14898, 18123, 18819, 25690, 26459, 41628, 51387, 71783, 80330, 85687, 88171, 97063, 123630, 155930, 164987, 234760, 414840, 584995, 702038, 727699, 992700, 1201046, 1232255, 2312734, 3136255, 4235414, 6090515, 11484018, 11731850, 11895718, 16819291, 17748034, 18196595, 18924988, 20928756, 22103376, ... (sequence A002235 in the OEIS)
The primes for 234760 ≤ n ≤ 3136255 were found by the distributed computing project 321 search.
In 2008, PrimeGrid took over the search for Thabit primes. It is still searching and has already found all currently known Thabit primes with n ≥ 4235414. It is also searching for primes of the form 3·2$^n$+1, such primes are called Thabit primes of the second kind or 321 primes of the second kind.
The first few Thabit numbers of the second kind are:
    4, 7, 13, 25, 49, 97, 193, 385, 769, 1537, 3073, 6145, 12289, 24577, 49153, 98305, 196609, 393217, 786433, 1572865, ... (sequence A181565 in the OEIS)
The first few Thabit primes of the second kind are:
    7, 13, 97, 193, 769, 12289, 786433, 3221225473, 206158430209, 6597069766657, 221360928884514619393, ... (sequence A039687 in the OEIS)
Their n values are:
    1, 2, 5, 6, 8, 12, 18, 30, 36, 41, 66, 189, 201, 209, 276, 353, 408, 438, 534, 2208, 2816, 3168, 3189, 3912, 20909, 34350, 42294, 42665, 44685, 48150, 54792, 55182, 59973, 80190, 157169, 213321, 303093, 362765, 382449, 709968, 801978, 916773, 1832496, 2145353, 2291610, 2478785, 5082306, 7033641, 10829346, 16408818, ... (sequence A002253 in the OEIS)

## Connection with amicable numbers

When both n and n−1 yield Thabit primes (of the first kind), and $9\cdot 2^{2n-1}-1$ is also prime, a pair of amicable numbers can be calculated as follows:
    $2^{n}(3\cdot 2^{n-1}-1)(3\cdot 2^{n}-1)$ and $2^{n}(9\cdot 2^{2n-1}-1).$
For example, n = 2 gives the Thabit prime 11, and n−1 = 1 gives the Thabit prime 5, and our third term is 71. Then, 2$^2$=4, multiplied by 5 and 11 results in 220, whose divisors add up to 284, and 4 times 71 is 284, whose divisors add up to 220.
The only known n satisfying these conditions are 2, 4 and 7, corresponding to the Thabit primes 11, 47 and 383 given by n, the Thabit primes 5, 23 and 191 given by n−1, and our third terms are 71, 1151 and 73727. (The corresponding amicable pairs are (220, 284), (17296, 18416) and (9363584, 9437056))

## Generalization

For integer b ≥ 2, a Thabit number base b is a number of the form (b+1)·b$^n$ − 1 for a non-negative integer n. Also, for integer b ≥ 2, a Thabit number of the second kind base b is a number of the form (b+1)·b$^n$ + 1 for a non-negative integer n.
The Williams numbers are also a generalization of Thabit numbers. For integer b ≥ 2, a Williams number base b is a number of the form (b−1)·b$^n$ − 1 for a non-negative integer n. Also, for integer b ≥ 2, a Williams number of the second kind base b is a number of the form (b−1)·b$^n$ + 1 for a non-negative integer n.
For integer b ≥ 2, a Thabit prime base b is a Thabit number base b that is also prime. Similarly, for integer b ≥ 2, a Williams prime base b is a Williams number base b that is also prime.
Every prime p is a Thabit prime of the first kind base p, a Williams prime of the first kind base p+2, and a Williams prime of the second kind base p; if p ≥ 5, then p is also a Thabit prime of the second kind base p−2.
It is a conjecture that for every integer b ≥ 2, there are infinitely many Thabit primes of the first kind base b, infinitely many Williams primes of the first kind base b, and infinitely many Williams primes of the second kind base b; also, for every integer b ≥ 2 that is not congruent to 1 modulo 3, there are infinitely many Thabit primes of the second kind base b. (If the base b is congruent to 1 modulo 3, then all Thabit numbers of the second kind base b are divisible by 3 (and greater than 3, since b ≥ 2), so there are no Thabit primes of the second kind base b.)
The exponent of Thabit primes of the second kind cannot congruent to 1 mod 3 (except 1 itself), the exponent of Williams primes of the first kind cannot congruent to 4 mod 6, and the exponent of Williams primes of the second kind cannot congruent to 1 mod 6 (except 1 itself), since the corresponding polynomial to b is a reducible polynomial. (If n ≡ 1 mod 3, then (b+1)·b$^n$ + 1 is divisible by b$^2$ + b + 1; if n ≡ 4 mod 6, then (b−1)·b$^n$ − 1 is divisible by b$^2$ − b + 1; and if n ≡ 1 mod 6, then (b−1)·b$^n$ + 1 is divisible by b$^2$ − b + 1) Otherwise, the corresponding polynomial to b is an irreducible polynomial, so if Bunyakovsky conjecture is true, then there are infinitely many bases b such that the corresponding number (for fixed exponent n satisfying the condition) is prime. ((b+1)·b$^n$ − 1 is irreducible for all nonnegative integer n, so if Bunyakovsky conjecture is true, then there are infinitely many bases b such that the corresponding number (for fixed exponent n) is prime)
Pierpont numbers $3^{m}\cdot 2^{n}+1$ are a generalization of Thabit numbers of the second kind $3\cdot 2^{n}+1$.