Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program Project2;
- {$APPTYPE CONSOLE}
- uses
- SysUtils;
- var
- n,p, i: integer;
- BellNs : array[1..26] of Int64;
- IsPrime : boolean;
- begin
- i:= 0;
- BellNs[1] := 1;
- BellNs[2] := 1;
- BellNs[3] := 2;
- BellNs[4] := 5;
- BellNs[5] := 15;
- BellNs[6] := 52;
- BellNs[7] := 203;
- BellNs[8] := 877;
- BellNs[9] := 4140;
- BellNs[10] := 21147;
- BellNs[11] := 115975;
- BellNs[12] := 678570;
- BellNs[13] := 4213597;
- BellNs[14] := 27644437;
- BellNs[15] := 190899322;
- BellNs[16] := 1382958545;
- BellNs[17] := 10480142147;
- BellNs[18] := 82864869804;
- BellNs[19] := 682076806159;
- BellNs[20] := 5832742205057;
- BellNs[21] := 51724158235372;
- BellNs[22] := 474869816156751;
- BellNs[23] := 4506715738447323;
- BellNs[24] := 44152005855084346;
- BellNs[25] := 445958869294805289;
- BellNs[26] := 4638590332229999353;
- for n:= 1 to 25 do
- for p:= 2 to 25 do
- begin
- if (n + p <= 26) then
- begin
- IsPrime := true;
- for i:= 2 to Trunc(sqrt(p)) do
- if (p mod i) = 0 then
- IsPrime := false;
- if IsPrime = true then
- begin
- if (BellNs[n+p] mod p) = ((BellNs[n] + BellNs[n+1]) mod p) then
- Writeln('B(',n,'+',p,') = B(',n ,') + B(',n ,'+1) (mod ',p,')');
- end;
- end;
- end;
- readln;
- end.
Advertisement
Add Comment
Please, Sign In to add comment