login
A147789
a(n) = round(2*(3/2)^n), using round-to-even method.
3
3, 4, 7, 10, 15, 23, 34, 51, 77, 115, 173, 259, 389, 584, 876, 1314, 1971, 2956, 4434, 6651, 9976, 14964, 22445, 33668, 50502, 75754, 113630, 170445, 255668, 383502, 575253, 862880, 1294320, 1941479, 2912219, 4368329, 6552493, 9828740, 14743110
OFFSET
1,1
COMMENTS
See Wikipedia link and MathWorld link for different methods of rounding half-integers.
Different from recursion a(1) = 3, a(n) = round(a(n-1)*3/2) for n > 1, which gives a(2) = 4, a(3) = 6, a(4) = 9, a(5) = 14, ... (see A147790).
LINKS
Eric Weisstein's World of Mathematics, Nearest Integer Function
Wikipedia, Rounding
EXAMPLE
a(4) = round(2*(3/2)^4) = round(81/8) = round(10 + 1/8) = 10.
MATHEMATICA
Round[2(3/2)^Range[40]] (* Harvey P. Dale, Feb 04 2012 *)
PROG
(Magma) RoundToEven:=function(n); d:=Floor(n); if n-d ne 1/2 then return Round(n); else return d+(d mod 2); end if; end function; [ RoundToEven(2*(3/2)^n):n in [1..39] ]; // Klaus Brockhaus, Nov 17 2008
(PARI) {RoundToEven(n)=local(d); d=divrem(n, 1); if(d[2]<>1/2, round(n), d[1]+d[1]%2)}
{for(n=1, 39, print1(RoundToEven(2*(3/2)^n), ", "))} \\ Klaus Brockhaus, Nov 17 2008
CROSSREFS
KEYWORD
nonn
AUTHOR
EXTENSIONS
Edited by Klaus Brockhaus, Nov 17 2008
STATUS
approved