Thank you for your interest.
Pram deals with the conversion of Julian Day (JD) to the Hebrew calendar. Input data: (JD) e.g. 2458541. Output data: day, month, year. As for JD, there is no need to use the Input function because JD will be downloaded automatically from another subprogram. Thank you very much to those who will change the code.
program J2Jewish;
{$APPTYPE CONSOLE}
uses
SysUtils,
math;
procedure JD2Jewish(JD:integer; var j,m,d:integer);
function c4(x1,x3:integer):integer;
function c1(x1:integer):integer;
begin
c1:=floor((235*x1+1)/19);
end;
function q(x1:integer):integer;
begin
q:=floor(c1(x1)/1095);
end;
function r(x1:integer):integer;
begin
r:=c1(x1) mod 1095;
end;
function v1(x1:integer):integer;
begin
v1:=32336*q(x1) + floor((15*q(x1)+765433*r(x1)+12084)/25920);
end;
function v2(x1:integer):integer;
begin
v2:=v1(x1) + floor(6*(v1(x1)/7)) mod 2;
end;
function L2(x1:integer):integer;
begin
L2:=v2(x1+1) - V2(x1);
end;
function c2(x1:integer):integer;
var v3,v4:integer;
begin
v3:=2*(floor((L2(x1)+19)/15) mod 2);
v4:=floor((L2(x1-1)+7)/15) mod 2;
c2:=v2(x1)+v3+v4
end;
var L,c8,c9,c3:integer;
begin
L:=c2(x1+1)-c2(x1);
c8:=floor((L+7)/2) mod 15;
c9:=-(floor((385-L)/2) mod 15);
c3:=floor((384*x3+7)/13) + c8*floor((x3+4)/12) + c9*floor((x3+3)/12);
c4:=c2(x1)+c3;
end;
var
y4,y1p,gam1,ksi1,mi1,ksi2,mi2,c41p,q,r,dz1,gam2,ksi3,c42p,c43p,dz2,gam3,mi3,z4,c,x3,x1:integer;
begin
y4:=JD-347821;
q:=floor(y4/1447);
r:=y4 mod 1447;
y1p:=49*q+floor((23*q+25920*r+13835)/765433);
gam1:=y1p+1;
ksi1:=floor((19*gam1+17)/235);
mi1:=gam1-floor((235*ksi1+1)/19);
c41p:=c4(ksi1,mi1);
dz1:=y4-c41p;
gam2:=gam1 + floor(dz1/33);
ksi2:=floor( (19*gam2+17)/235 );
mi2:=gam2-floor( (235*ksi2+1)/19 );
c42p:=c4(ksi2,mi2);
dz2:=y4-c42p;
gam3:=gam2 + floor(dz2/33);
ksi3:=floor( (19*gam3+17)/235 ); x1:=ksi3;
mi3:=gam3-floor( (235*ksi3+1)/19 ); x3:=mi3;
c43p:=c4(ksi3,mi3);
z4:=y4-c43p;
c:=floor((12-x3)/7);
j:=x1+1-c;
m:=x3+1;
d:=z4+1;
end;
var JD:integer;
j,m,d:integer;
begin
writeln(' np. JD=2057986');
write('JD ='); readln(JD);
//JD:=2057986;
JD2Jewish(JD, j,m,d);
writeln(j,' ',m,' ',d);
readln;
end.