OFFSET
0,1
LINKS
Colin Barker, Table of n, a(n) for n = 0..1000
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, 11][n+1], ceil(a(n-1)^2/a(n-2))-1)
end:
seq(a(n), n=0..30); # Alois P. Heinz, Sep 18 2015
MATHEMATICA
a = {4, 11}; Do[AppendTo[a, Floor[a[[n]]^2/a[[n - 1]]]], {n, 2, 27}];
a (* Michael De Vlieger, Sep 18 2015 *)
PROG
(PARI) T(a0, a1, maxn) = a=vector(maxn); a[1]=a0; a[2]=a1; for(n=3, maxn, a[n]=floor(a[n-1]^2/a[n-2])); a
T(4, 11, 100) \\ Colin Barker, Sep 18 2015
(Magma) Iv:=[4, 11]; [n le 2 select Iv[n] else Floor(Self(n-1)^2/Self(n-2)): n in [1..40]]; // Bruno Berselli, Feb 04 2016
(Python)
from itertools import islice
def A019495_gen(): # generator of terms
a, b = 4, 11
yield from (a, b)
while True:
a, b = b, (b**2-1)//a
yield b
CROSSREFS
KEYWORD
nonn
AUTHOR
STATUS
approved