# [seqfan] A053373 (fundamental unit for real quadratic field...)

Jean-François Alcover jf.alcover at gmail.com
Wed Dec 12 14:31:38 CET 2012

```Dear SeqFans,

Using this Mma program (coded after Max Alexeyev comment) :
g[n_] := Ceiling[Sqrt[n]] + n - 1;

r[n_] := Reduce[ an > 0 && (bn^2 - bn*an - g[n]*an^2 == 1 ||
bn^2 - bn*an - g[n]*an^2 == -1), {an, bn}, Integers] /. C -> c;

ab[n_] := DeleteCases[ Flatten[Table[{an, bn} /. {ToRules[r[n]]} //
Simplify, {c[1], 0, 1}], 1], an | bn]; a[n_] := a[n] = Min[ab[n][[All,
1]]];

Reap[ Do[ If[ Not[IntegerQ[Sqrt[n]] && Mod[n, 4] == 1], Print[{n, a[n]}];
Sow[a[n]]], {n, 0, 69}]][[2, 1]]

I get 3 more terms inserted  (352, 45, 5640) :

data :
{1, 1, 2, 1, 1, 8, 2, 10, 1, 40, 5, 2, 3, 250, 1, 1, 106, 3, 1138, 2,
8, 25, 146, 2968, 15, 298, 16, 2, 5, 17, 1856, 1, 1, 9384, 97, 10,
253970, 2, 72664, 3, 6440, 5, 521904, 1, 1, 3034, 5, 9148450,
1084152, 117, 2, 746, 10, 88, 157, 126890, 1, 1311, 56, 287};

output from Mma :
{1, 1, 2, 1, 1, 8, 2, 10, 1, 40, 5, 2, 3, 250, 1, 1, 106, 3, 1138, 2,
8, 25, 146, 1, 2968, 15, 298, 16, 2, 5, *352*, 17, 1856, 1, 1, 9384,
97, 10, 8, 253970, 2, 72664, 3, 6440, 5, 521904, 1, 3034, 5, 9148450,
3, 1084152, 117, 2, *45*, 746, 10, 88, 157, 126890, 1, 1, *5640*, 1311,
56, 287}

Can some expert explain the trouble ?

jfa
```