Automating Reduction by a Varying Modulus

  • Thread starter Thread starter middleCmusic
  • Start date Start date
  • Tags Tags
    Modulus Reduction
Click For Summary
SUMMARY

This discussion focuses on automating a mathematical process involving primality tests using even numbers. The user seeks to implement a method where an even number N is divided by 2k (where k is a natural number), and if the result is an integer, it is reduced modulo 2k+1. The goal is to identify values of k for which the reduction is odd. The user provides an example with N = 20, illustrating the calculations and expected outputs. Tools mentioned include Mathematica and Maple, indicating a need for programming assistance in this mathematical automation.

PREREQUISITES
  • Understanding of primality tests and modular arithmetic
  • Familiarity with even numbers and their properties
  • Basic programming skills in Mathematica or Maple
  • Knowledge of LaTeX for mathematical notation
NEXT STEPS
  • Learn how to implement modular arithmetic in Mathematica
  • Explore the use of loops and conditionals in Maple for automating calculations
  • Study the Sieve of Eratosthenes for alternative primality testing methods
  • Research mathematical automation techniques for complex calculations
USEFUL FOR

Mathematicians, computer scientists, and anyone interested in automating mathematical processes or exploring primality tests using programming tools like Mathematica and Maple.

middleCmusic
Messages
74
Reaction score
0
Hey guys,

I'm doing some experimenting recently with some primality tests, and I need help figuring out how to automate the following:

Given an even number N, divide by 2k (k \in \mathbb{N}).
If N/2k is an integer, reduce mod 2k+1.
(If N/2k is not an integer, simply move on to the next one.)
Do this for all 2k ≤ N/2.
Then print those k (or 2k, doesn't really matter to me) for which the resulting reduction by the modulus 2k+1 is odd.

EX: N = 20. 20/2 \equiv 1 (mod 3). 20/4 \equiv 0 (mod 5). 20/6 non-integer. 20/8 non-integer. 20/10 \equiv 10 (mod 11).
Print: 2k = 2 (or k = 1), since this is the only odd reduction that was obtained.

If it helps, I have Mathematica and Maple, as well as some basic understanding of LaTeX, but my programming skills are pretty crappy. Thanks in advance!

P. S. I wasn't sure if I should post this in the Computer Science forum, but I figured that it's more of a math topic anyway, and there are bound to be some math people who know how to do this.
 
Technology news on Phys.org
middleCmusic said:
Hey guys,

I'm doing some experimenting recently with some primality tests, and I need help figuring out how to automate the following:

Given an even number N, divide by 2k (k \in \mathbb{N}).
If N/2k is an integer, reduce mod 2k+1.
(If N/2k is not an integer, simply move on to the next one.)
Do this for all 2k ≤ N/2.
Then print those k (or 2k, doesn't really matter to me) for which the resulting reduction by the modulus 2k+1 is odd.

EX: N = 20. 20/2 \equiv 1 (mod 3). 20/4 \equiv 0 (mod 5). 20/6 non-integer. 20/8 non-integer. 20/10 \equiv 10 (mod 11).
I'm not following your logic here. In any case, 20/10 = 2 ##\equiv## 2 (mod 11). There's another way of checking for primes - the Sieve of Eratosthenes.
middleCmusic said:
Print: 2k = 2 (or k = 1), since this is the only odd reduction that was obtained.

If it helps, I have Mathematica and Maple, as well as some basic understanding of LaTeX, but my programming skills are pretty crappy. Thanks in advance!

P. S. I wasn't sure if I should post this in the Computer Science forum, but I figured that it's more of a math topic anyway, and there are bound to be some math people who know how to do this.
 
Oops my bad. That should have been a 2, yeah. The Sieve of Eratosthenes is not what I'm looking for though. I'm not expecting anyone to see my logic in doing this, just wondering if anyone knows how.
 

Similar threads

Replies
17
Views
3K
Replies
6
Views
3K
Replies
2
Views
3K
Replies
7
Views
4K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
Replies
6
Views
4K
Replies
8
Views
2K
  • · Replies 11 ·
Replies
11
Views
2K
Replies
9
Views
3K