⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 solution_diophantine_prime.m

📁 这是我用matlab编写的一个解不定方程的程序
💻 M
字号:
%judge that a nature number is a prime or not
function solution_diophantine_prime(cir_num_start,cir_num_end,cir_interval)
value_n=0;
value_n_divide_3=0;
for j=cir_num_start:cir_interval:cir_num_end;
    %disp(sprintf('@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@'));
    if j/3==floor(j/3)
      if isprime(j/3)==1;
        value_n=j
        disp(sprintf('the nature number is a prime'));
        %cir_num=((j-cir_num_start)/cir_interval)+1
        value_n_divide_3=j/3
          if mod(j/3-1,6)==0;
            disp(sprintf('*********************************the value is 1 after mod 6*********************************'));
            solution_diophantine(j)
          else
              value_n_divide_3_mod_6=mod(value_n_divide_3,6)
              disp(sprintf('!!!!!!the value is not 1 after mod 6!!!!!!'));
              solution_diophantine(j)
          end
      else
%         value_n=j
%         disp(sprintf('the nature number is not a prime'));
      end
    else
%         value_n=j
%         disp(sprintf('!!!!!!!!!!!!!!!!!!!!!!!the nature number can not be divided exactly by 3!!!!!!!!!!!!!!!!!!!!!!!'));
    end
end

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -