OFFSET
1,2
COMMENTS
Is this the same as A188040? - R. J. Mathar, Jul 22 2020
Indeed, it seems that A336109(1) = A188040(1) and A336109(n) = A188040(n-1) for n >= 3, but A336109(2) = 2 does not appear in A188040. Because of the way A120861 is constructed (cf. Michel Marcus's PARI program below), a(2) = 2 cannot be omitted. - Petros Hadjicostas, Jul 22 2020
LINKS
Clark Kimberling, The equation (j+k+1)^2 - 4*k = Q*n^2 and related dispersions, Journal of Integer Sequences, 10 (2007), Article #07.2.7; see Section 5.
PROG
(PARI) /* This is Michel Marcus's program from A120861. */
f(n) = 3*n + 2*sqrtint(2*n^2) + 2;
unused(listus) = {my(v=vecsort(Vec(listus))); for (i=1, vecmax(v), if (!vecsearch(v, i), return (i)); ); };
D(nb) = {my(m = matrix(nb, nb), t); my(listus = List); for (g=1, nb, if (g==1, t = 1, t = unused(listus)); m[g, 1]=t; listput(listus, t); t = f(t); m[g, 2]=t; listput(listus, t); for (h=3, nb, t = 6*m[g, h-1] - m[g, h-2]; m[g, h] = t; listput(listus, t); ); ); m; };
firstcol(nb) = my(m=D(nb)); vector(nb, k, m[k, 1]);
CROSSREFS
KEYWORD
nonn
AUTHOR
Petros Hadjicostas, Jul 08 2020
STATUS
approved