11

I was wondering, can a prime number be negative? We had a question over at security.se which stated that prime generation with openssl:

openssl dhparam -text 1024

results in a 1024-bit number to which leading zeros are added (resulting in 1032 bits). It could be the case that this is done to sign the integer, however it was my believe that negative primes did not exist?

  • 9
    Depends on the definition, but mathematicians consider $-7$ a prime, usually. In algebra, they are considered the "same prime" in some obvious sense. Usually, you don't need to deal with the negative primes, but in other algebras there's no obvious way to pick the "right" primes. – Thomas Andrews Aug 05 '13 at 04:27
  • http://en.wikipedia.org/wiki/Prime_number – Amzoti Aug 05 '13 at 04:28
  • 1
    on a sidenote, all these openssl computations should be performed with unsigned big integers and the padding to $1032$ bits is only needed to prevent an accidental interpretation of negative numbers in case some programmer forgot that restriction. :) – Hagen von Eitzen Aug 05 '13 at 05:54
  • Since nobody bring that up yet, may I bring up Gaussian integers? In any case, it should not have any effect (at least not on RSA), other than the fact that you need to be careful when computing $\varphi$ and some implementation-dependent issue on dividing by negative number – Gina Jan 05 '14 at 19:26
  • @ThomasAndrews is there anything you can cite pertainging to "mathematicians consider −7 a prime". I have just never heard of negatives being considered prime. Every defenition I have ever seen only considers Natrual numbers > 1. – KBusc Sep 08 '14 at 16:54
  • In other algebras, it is hard to distinguish "positive" and "negative." For example, in the Gaussian integers, $\mathbb Z[i]$, $2-i$ is prime, as is $-2+i=-(2-i)$. Which one of these is "the real prime?" Mathematicians basically consider both prime. If $p$ is prime and $u$ is a unit, then $pu$ is prime. $-7$ is, from an algebraic point of view, the same prime as $7$, but it is just as prime as $7$ is. – Thomas Andrews Sep 08 '14 at 17:00

3 Answers3

0

A prime number like $7$ represents all of the values that both divide 7 and are multiples of it. Then 7 simply os the representive form of it. So, of the integers, 7 represents both 7 and -7.

Sometimes you might want all primes to be 1 modulo 4 or 6, in which case, you might get -7 as the name form.

In other systems, like the gaussian integers, a prime likr $2+i$, can represent that and its multiples by powers of $i$. Other systems, like $x+y\sqrt{2}$, a prime like $1+2\sqrt{2}$, is one of an infinite number of values that divide this, and are divisable by this prime.

For the integers, it is usually representive to make the name prime greater than zero.

  • Are you referring to prime ideals? – Zach L. Aug 05 '13 at 05:58
  • I don't know that term. You can take in an integer set, that $x \mid y \mid x$, where $y = xU$ and U a unit. So for a prime $p$, one can use $pU$ as a representative value of it. In the integers, $U = \pm 1$. – wendy.krieger Aug 05 '13 at 08:05
  • 2
    The sentence «A prime number like 7 represents all of the values that both divide 7 and are multiples of it» is quite confused. The number seven does not represent anything... – Mariano Suárez-Álvarez Jan 05 '14 at 19:11
  • For the set N, all primes are positive, because the set itself is positive. But you have sets with negative numbers, and then one can use either 7 or -7 as a possible representive. Gauss law of quadratic recriprolity puts all primes >2 as $1 \pmod{4}$, so half the primes are negative. In other integer systems, numbers like 2 and 3 are composite, the is no unique representation of the primes involved because of multiple units. – wendy.krieger Jan 07 '14 at 03:40
  • @skullpatrol 7 is a generic number, and -1 a generic unit. We have then $ 7\mid-7 \mid 7$, which says 7 goes into -7 etc. In gaussian integers, $7 \mid 7i \mid 7$, but 7i is not the additive inverse of 7. You could argue 7 as the normal form, but 7i is just as valid. – wendy.krieger Jan 07 '14 at 03:48
  • @skullpatrol 7 is here a random prime. It can be replaced by any prime, for example, 107 or 117 (by the long count). When one says '7 is a prime', the actual need could call for something that leaves a remainder of 1, modulo 4, so -7 could be the needed representation of the prime '7'. But once 7 is represented, you don't invoke other members of the set. – wendy.krieger Jan 09 '14 at 10:47
0

Please refer to the below link:

Link

I think this explains the best.

Glorfindel
  • 3,955
bivs06
  • 1
0

Primes are always modulo units in algebra. For example, let $p(x)$ with coefficients in $\mathbb{R}$ be a polynomial that can not be divided by any other polynomial over $\mathbb{R}$. Then $a\cdot p(x)$ is prime for all $a\in \mathbb{R}$, $a\ne 0$.

A unit is an element with inverse, in this case $a$ is a unit-polynomial.

Lehs
  • 13,791
  • 4
  • 25
  • 77