# [seqfan] Re: Number of points with maximum norm n in A2, A3, A4, A5, D5

Joerg Arndt arndt at jjj.de
Fri Feb 5 12:44:34 CET 2010

```* Richard Mathar <mathar at strw.leidenuniv.nl> [Feb 04. 2010 10:24]:
> [...]
>
> 5) I've tried to calculate
> "Number of lattice points in the D5 lattice with maximum norm n"
> and get for n>=0
> 1,120,1442,6840,21122,51000
>
> [...]

looks OK:

[1, 120, 1442, 6840, 21122, 51000, 105122, 194040, 330242, 528120, 804002]

For D3 (A110907):
? Dnct(3,10)
? vc_
[1, 12, 50, 108, 194, 300, 434, 588, 770, 972, 1202]
? gf=ggf(vc_)
(x^4 + 10*x^3 + 26*x^2 + 10*x + 1)/(-x^4 + 2*x^3 - 2*x + 1)
? factor(gf)

[x^2 + 4*x + 1 1]

[x^2 + 6*x + 1 1]

[x - 1 -3]

[x + 1 -1]

Code (primitive and somewhat slow):

---------------------------------
Dnct(d,m)=
{
if ( d<2, error("oink!") );
vm_=vector(m);    \\ == max ( abs(x), abs(y), abs(z), ... )
vp_=vector(m+1);  \\ parity
vc_=vector(m+1);  \\ count
m_ = m;
d_ = d;
rec(1);
} /* ----- */

rec(d)=
{
for (x=-m_, m_,
if ( d==1,
vm_[d] = abs(x);
vp_[d] = bitand(x, 1);
rec(d+1);
, /* else */
vm_[d] = max(vm_[d-1], abs(x));
vp_[d] = bitxor(vp_[d-1], bitand(x, 1));
if ( d==d_,
if ( vp_[d]==0,
vc_[vm_[d]+1] += 1;
);
, /* else */
rec(d+1);
);
);
);
} /* ----- */

\r ggf.gpi

default(echo,1);

Dnct(3,10)
vc_
gf=ggf(vc_)
factor(gf)
---------------------------------

```