1
$\begingroup$

Question:

which $n$ and $k$ satisfy $\frac{k^n-1}{2^n-1}\in\mathbb{N}$?

The motivation for the question is a constraint on the cardinality of interpolation-constraints for the $2^n$ corners of a hypercube $[0,1]^n$:

  • for one of the corners, e.g. $(1_1,\,\dots,\,1_n)$ there shall be exactly one constraint
  • for all other corners the number of constraints shall be equal

$n=2; k=2m, k=6m\pm1$ are examples of valid solutions

$\endgroup$
1
  • 1
    $\begingroup$ Any $k$ congruent to a power of 2 modulo $2^n-1$ works $\endgroup$ Commented Dec 20, 2022 at 22:15

1 Answer 1

2
$\begingroup$

So we are trying to solve

$$k^n - 1 \equiv 0 \mod 2^n - 1 $$

I.E

$$ k^n \equiv 1 \mod 2^n - 1 $$

A class of solutions can be found by looking at the carmichael function. Namely

$$ k^{\lambda(2^n - 1)} \equiv 1 \mod 2^n - 1 $$

So we want that $\lambda(2^n - 1) = n$

Just going through this table: https://en.wikipedia.org/wiki/Carmichael_function

We see here that $\lambda(2^4 - 1) = 4$ so for any choice of $k>2$ coprime to 15 and $n=4$ this identity holds. So you can find some cool tricks like $$ \frac{11^4 - 1}{2^4 - 1} = 976$$

The next instance is $\lambda(2^6 - 1) = \lambda(63) = LCM(\lambda(3), \lambda(7)) = LCM(2,6) = 6 $

I wrote some code to find more instances, up to $n=50$ the only values are: 4, 6, 12. Found using the python 3.8 code below:

import math

prime_list = [2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,57,67,71,73,79,83,89,97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997]


def lcm(a, b):
    return a*b // math.gcd(a, b)


def carm_prime_power(prime, power):
    if prime == 2 and power > 2:
        return 2**(power - 2)
    return (prime-1)*prime**(power - 1)

def carmichael(n):
    factor_list = {}
    for primes in prime_list:
        if n%primes == 0:
            factor_list[primes] = 1
            n = n//primes
            while n%primes == 0:
                factor_list[primes] += 1
                n = n//primes

    current_lcm = 1
    for primes in factor_list:
        current_lcm = lcm(current_lcm, carm_prime_power(primes, factor_list[primes]))

    return current_lcm



if __name__ == '__main__':
    n = 4
    while n < 50:
        if carmichael(2**n - 1) == n:
            print(n)
        n+=1
              

When $n \ne \lambda(2^n -1)$ it probably gets a lot more complex to characterize solutions. If you're interested I can write some code to search for such solutions.

$\endgroup$
6
  • $\begingroup$ Very nice and extensive answer; I would of course appreciate if you could provide additional code. $\endgroup$ Commented Dec 20, 2022 at 19:39
  • $\begingroup$ What does it mean to be "a carmichael number of $2^n-1$"? Do you mean, when $n$ doesn't equal $\lambda(2^n-1)$? $\endgroup$ Commented Dec 20, 2022 at 21:00
  • 1
    $\begingroup$ yes let me edit that. $\endgroup$ Commented Dec 20, 2022 at 21:04
  • $\begingroup$ For $n=3$, we want $k^3\equiv1\bmod7$, which holds precisely for $k\equiv1,2,4\bmod7$. $\endgroup$ Commented Dec 20, 2022 at 21:05
  • 1
    $\begingroup$ strange, i did some experimental lookup and a lot of numbers to the power 8 are 1 mod 255. I wonder why that is: [1, 2, 4, 8, 13, 16, 19, 26, 32, 38, 43, 47, 49, 52, 53, 59, 64, 67, 76, 77, 83, 86, 89, 94, 98, 101, 103, 104, 106, 118, 121, 127, 128, 134, 137, 149, 151, 152, 154, 157, 161, 166, 169, 172, 178, 179, 188, 191, 196, 202, 203, 206, 208, 212, 217, 223, 229, 236, 239, 242, 247, 251, 253, 254]. Edit: its exactly 64 values $\endgroup$ Commented Dec 20, 2022 at 21:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .