|
|
A147790
|
|
a(1) = 3, a(n) = round(a(n-1)*3/2) for n > 1, using round-to-even method.
|
|
2
|
|
|
3, 4, 6, 9, 14, 21, 32, 48, 72, 108, 162, 243, 364, 546, 819, 1228, 1842, 2763, 4144, 6216, 9324, 13986, 20979, 31468, 47202, 70803, 106204, 159306, 238959, 358438, 537657, 806486, 1209729, 1814594, 2721891, 4082836, 6124254, 9186381, 13779572
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
COMMENTS
|
See Wikipedia link and MathWorld link for different methods of rounding half-integers.
|
|
LINKS
|
|
|
EXAMPLE
|
a(2) = round(3*3/2) = 4;
a(3) = round(4*3/2) = 6;
a(4) = round(6*3/2) = 9.
|
|
MATHEMATICA
|
lst={}; s=2; Do[s=Round[s*1.5]; AppendTo[lst, s], {n, 1, 5!}]; lst
|
|
PROG
|
(Magma) RoundToEven:=function(n); d:=Floor(n); return n-d ne 1/2 select Round(n) else d+(d mod 2); end function; [ n eq 1 select 3 else RoundToEven(Self(n-1)*3/2): 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)} {a=2; while(a<10^7, print1(a=RoundToEven(a*3/2), ", "))} \\ Klaus Brockhaus, Nov 17 2008
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,changed
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|