K
K
Kirill Taran2015-10-01 14:35:03
Mathematics
Kirill Taran, 2015-10-01 14:35:03

What is the physical meaning of the module in modular exponentiation?

Today I watched a task about the last ten digits of an expression 1^1 + 2^2 + ... + n^n. In this case, intuitively , I'm not a mathematician, it is clear that the module should be @mod = power(10, 10), and Wikipedia gives examples 595^703 (mod 991).
Question: what can the choice of module give 991? How and what modules are used in practice?
Pseudo-SQL to get attention:

function dbo.ufnModPow (@number numeric, @exp numeric, @mod numeric)
returns numeric 
as
begin
  declare @e numeric = 1
  declare @c numeric = 1
  
  while @e < @exp + 1
  begin
    set @c = (@c * @number) % @mod
    set @e = @e + 1
  end

  return @c
end

while @curr < @number + 1
begin
  set @sum = @sum + dbo.ufnModPow (@curr, @curr, @mod)
  set @curr = @curr + 1
end

print @sum

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Martyanov, 2015-10-01
@xkeirainx

I won’t say anything for the physical meaning, but the operation A ^ B (mod N) (BN_mod_exp in OpenSSL) is very often used in the implementation of RSA.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question