back to list

More on Jacks

🔗Gene Ward Smith <gwsmith@svpal.org>

1/5/2004 12:59:18 PM

Calling my former A and B "upjack" and "downjack" I give some types
beyond square and triangular. The two upjack types are in the Sloane list.

A045944 n*(3*n+2) rhombic matchstick numbers upjack(2/3)

A033954 n*(4*n+3) second decagonal numbers upjack(3/4)

(2*n+3)*(3*n+2) downjack(2/3)

(3*n+5)*(4*n+3) downjack(3/4)

Here is some Maple code:

farey:=proc(n)

# nth row of farey sequence

local p,q,s,t;

s:=[];

for q from 1 to n do

for p from 1 to q do

if igcd(p,q)=1 then

s:=[p/q,op(s)] fi od od;

RETURN(sort(s)) end:

nex := proc(q, n)

# next in row n of farey sequence from q

local r,s;

s := n - modp(n+1/numer(q), denom(q));

r := modp(1/denom(q), s);

r/s end:

pre := proc(q, n)

# previous in row n of farey sequence from q

local r,s;

s := n - modp(n-1/numer(q), denom(q));

r := modp(-1/denom(q), s);

r/s end:

med := proc(p, q)

# mediant

(numer(p)+numer(q))/(denom(p)+denom(q)) end:

comma := proc(q)

# comma induced by q

local p,d,w;

p := q;

if q>1 then p := 1/q fi;

d := denom(p);

w := pre(p,2*d)*nex(p,2*d)/p^2;

if w<1 then w := 1/w fi;

w end:

comr := proc(q,n)

# recursive comma induction

local p,d,w;

p := q;

if q>1 then p := 1/q fi;

d := denom(p);

if n=1 then w := comma(q) fi;

if n>1 then

w := comr(pre(p,2*d), n-1)/comma(nex(p,2*d), n-1) fi;

if w<1 then w := 1/w fi;

w end:

downjack := proc(r, n)
# B(r, n) in tuning-math message 849
local u, v, a, b, s;
u := numer(r);
v := denom(r);
s := pre(r, v);
a := numer(s);
b := denom(s);
((n*v-v+b)*(n*u+a))/((n*u-u+a)*(n*v+b)) end:

upjack := proc(r, n)
# A(r, n) in tuning-math message 849
local u, v, a, b, s;
u := numer(r);
v := denom(r);
s := nex(r, v);
a := numer(s);
b := denom(s);
((n*u-u-a)*(n*v-b))/((n*v-v-b)*(n*u-a)) end: