cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A258911 a(1)=a(2)=1, a(n) = ceiling(Pi*a(n-1) - a(n-2)), n>2.

Original entry on oeis.org

1, 1, 3, 9, 26, 73, 204, 568, 1581, 4399, 12239, 34051, 94736, 263571, 733297, 2040150, 5676024, 15791606, 43934770, 122233545, 340073237, 946138039, 2632307076, 7323498533, 20375142114, 56686898249, 157712000980
Offset: 1

Views

Author

Morris Neene, Jun 14 2015

Keywords

Comments

Ratio of consecutive terms approaches (Pi + sqrt(Pi^2 - 4))/2, or approximately 2.782159649779516149316 (A189039).

Examples

			a(3) = ceiling(Pi*1 - 1) = 3;
a(4) = ceiling(Pi*3 - 1) = 9;
a(5) = ceiling(Pi*9 - 3) = 26.
		

Crossrefs

Cf. A189039.

Programs

  • Magma
    I:=[1,1]; [n le 2 select I[n] else Ceiling(pi*Self(n-1)-Self(n-2)): n in [1..200]];
    
  • 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 *)
  • 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 */