View Single Post
Old 2020-07-30, 12:01   #20
Citrix
 
Citrix's Avatar
 
Jun 2003

22×5×79 Posts
Default

Quote:
Originally Posted by JeppeSN View Post
For the LCM, with PARI, using lcm(apply(x->x-1,primes([3,23]))), you get 7920.

When you try to find the member from 2^1, 2^2, 2^3, ..., 2^7920 (mod 23#) with the least hammingweight, then nothing beats the first few terms in that list; they clearly have only one '1' bit?

/JeppeSN
1. correction:Replace p-1 with smallest n such that 2^n==1 (mod p). Then calculate the LCM

2. 2^1, 2^2, 2^3, ..., 2^7920 (mod 23#) -- only consider terms greater than 23# otherwise the number is 23# itself.
Let m==2^n (mod 23#)
You need to find the number of '1' bits in 2^n+23#-m
Citrix is offline   Reply With Quote