OFFSET
0,1
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..2025
D. W. Boyd, Linear recurrence relations for some generalized Pisot sequences, Advances in Number Theory ( Kingston ON, 1991) 333-340, Oxford Sci. Publ., Oxford Univ. Press, New York, 1993;.
MAPLE
a:= proc(n) option remember;
`if`(n<2, [4, 12][n+1], floor(a(n-1)^2/a(n-2))+1)
end:
seq(a(n), n=0..40); # Alois P. Heinz, Sep 18 2015
MATHEMATICA
S[a_, b_, n_] := Block[{s = {a, b}, k}, Do[k = Last@ s + 1; While[k/s[[i - 1]] <= s[[i - 1]]/s[[i - 2]], k++]; AppendTo[s, k], {i, 3, n}]; s]; S[4, 12, 14] (* Michael De Vlieger, Feb 15 2016 *)
PROG
(PARI) S(a0, a1, maxn) = a=vector(maxn); a[1]=a0; a[2]=a1; for(n=3, maxn, a[n]=a[n-1]^2\a[n-2]+1); a
S(4, 12, 40) \\ Colin Barker, Feb 15 2016
CROSSREFS
KEYWORD
nonn
AUTHOR
STATUS
approved