OFFSET
1,3
COMMENTS
Ratio of consecutive terms approaches (Pi + sqrt(Pi^2 - 4))/2, or approximately 2.782159649779516149316 (A189039).
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..1000
EXAMPLE
a(3) = ceiling(Pi*1 - 1) = 3;
a(4) = ceiling(Pi*3 - 1) = 9;
a(5) = ceiling(Pi*9 - 3) = 26.
MATHEMATICA
RecurrenceTable[{a[n] == Ceiling[Pi*a[n - 1] - a[n - 2]], a[1] == 1,
a[2] == 1}, a, {n, 1, 50}] (* G. C. Greubel, Jun 03 2017 *)
nxt[{a_, b_}]:={b, Ceiling[b*Pi-a]}; NestList[nxt, {1, 1}, 30][[All, 1]] (* Harvey P. Dale, Apr 02 2020 *)
PROG
(Magma) I:=[1, 1]; [n le 2 select I[n] else Ceiling(pi*Self(n-1)-Self(n-2)): n in [1..200]];
(PARI) main(size)={my(v=vector(size), i); v[1]=1; v[2]=1; for(i=3, size, v[i]=ceil(Pi*v[i-1]-v[i-2])); return(v); } /* Anders Hellström, Jul 14 2015 */
CROSSREFS
KEYWORD
nonn
AUTHOR
Morris Neene, Jun 14 2015
STATUS
approved