Unless we are told something to the contrary, unknowns in equations such as this are always assumed to be integers.
If d is the greatest common divisor (gcd) of a and n, the linear congruence
ax≡bmodn
has a solution only if b is also divisible by d and in that case there will be an infinite number of solutions given by
x=x0+ntd,
where x0 is any solution whatever, and t is an integer, (positive or negative), or zero.
For the equation in question,
7x=1mod26,d=1,
so the general solution will be
x=x0+26t1=x0+26t.
Finding a suitable x0 is a trial and error thing, run through the multiples of 7 and 26 looking for the first pair for which the multiple of 7 is 1 greater than the multiple of 26 That happens to be 15 and 4, so the general solution is
x=15+26t,t∈Z.
The result given earlier comes from the theory of linear Diophantine equations.
If
d=gcd(a,b),
the equation
ax+by=c
has integer solutions only if c is also divisible by d, and in that case there will be an infinite number of solutions given by
x=x0+btd,y=y0−atd(t∈Z),
and where x0,y0 is any particular solution.
(For large values of a and b, x0,y0 and d are usually found using Euclid's algorithm.)
( The equation
ax≡bmodn
is equivalent to
ax−b=kn⇒ax−kn=b,
which, with a change of letters and a change of sign, is the Diophantine equation above.)
If X must be a whole number:
Can't remember if there is a faster way, but you need to find a multiple of 26 that when 1 is added to it is a multiple of 7.
If X can be anything, fractional too, then X=27/7 is one such X
Here's a pattern...
[11*26 + 1 ] / 7 = 41
[25*26 + 1] / 7 = 93
[39*26 + 1 ] / 7 = 145
[53*26 + 1 ] = 197
So....it appears that the pattern [(-3 ± 14n) *26 + 1 ] / 7 will produce an integer ....for n= 0, 1, 2, 3......
So "X" must be, in general, [41 ± 52k] for k = 0, 1, 2, 3........
Thanks Chris and TheMathsStudent
I thought there was some definative way to do this.
7Xmod26=17x26=N+126$WhereXandNarebothintegers$7X=26N+1
Multiples of 26 are 26,52,78, 104,130, 156, 182,
(Multiples of 26) +1 are 27,53,79, 105, 105 = 7*15
So X=15 works this is one solution
7*15=26(N)+1 N=4
-----------------------------------------------------
(7×15)mod(26)=1
That is good X=15 is the smallest value of X
--------------------------------------------------------
Now I want to find a general solution
If (7*15) mod 26=1
Then I think
(7*15+26G) mod 26 must also =1
Thinking, thinking. :/
okay, I am thinking here ....
if
7K mod 26=1
I know that k=15 is the smallest integer solution
so
(7*15) mod 26 =1
so
(7*15+26N) mod 26 =1
so
[7(15+26N7)]=1 where N is an integer.
So K=15+26N7 is a general solutions
NOW Wolfram|Alpha gave the general solution as K=15+26N where K is an integer.
But why did Wolfram|Alpha care about K being an integer?
I can see that N must be an integer, but why does K have to be an integer
Would any other mathematician care to comment?
Unless we are told something to the contrary, unknowns in equations such as this are always assumed to be integers.
If d is the greatest common divisor (gcd) of a and n, the linear congruence
ax≡bmodn
has a solution only if b is also divisible by d and in that case there will be an infinite number of solutions given by
x=x0+ntd,
where x0 is any solution whatever, and t is an integer, (positive or negative), or zero.
For the equation in question,
7x=1mod26,d=1,
so the general solution will be
x=x0+26t1=x0+26t.
Finding a suitable x0 is a trial and error thing, run through the multiples of 7 and 26 looking for the first pair for which the multiple of 7 is 1 greater than the multiple of 26 That happens to be 15 and 4, so the general solution is
x=15+26t,t∈Z.
The result given earlier comes from the theory of linear Diophantine equations.
If
d=gcd(a,b),
the equation
ax+by=c
has integer solutions only if c is also divisible by d, and in that case there will be an infinite number of solutions given by
x=x0+btd,y=y0−atd(t∈Z),
and where x0,y0 is any particular solution.
(For large values of a and b, x0,y0 and d are usually found using Euclid's algorithm.)
( The equation
ax≡bmodn
is equivalent to
ax−b=kn⇒ax−kn=b,
which, with a change of letters and a change of sign, is the Diophantine equation above.)