# [seqfan] Re: Rounding in A075465

Harvey P. Dale hpd at hpdale.org
Sat Oct 3 15:10:15 CEST 2015

```	I have added Bob Wilson's function and code to the Mathematica field in A075465.
A quick on-line search for rules about rounding disclosed no consensus about whether the fraction 1/2 should be rounded up or down.  The code Bob provided is consistent with the rule that the fraction 1/2 should be rounded down.
Best,
Harvey

-----Original Message-----
From: SeqFan [mailto:seqfan-bounces at list.seqfan.eu] On Behalf Of Robert G. Wilson v
Sent: Saturday, October 3, 2015 7:44 AM
To: 'Sequence Fanatics Discussion list' <seqfan at list.seqfan.eu>
Subject: [seqfan] Re: Rounding in A075465

et al,

I ran the following two versions of Mathematica:
Round[ Accumulate[ Prime[ Range[1000]]]/Range[1000]]; rnd[n_] := Block[{ip = IntegerPart[n]}, If[n > ip + 1/2, ip + 1, ip]];; r = Range at 1000; rnd@# & /@ (Accumulate[Prime[r]]/r);

I then compared their results;  they were identical. BUT if the range was increased to 10000, they differ.

In fact that differ at: 1810, 2458, 240926, 317602, ..., .

Therefore I suggest that the Mathematica coding in A075465 be changed.

Bob.

-----Original Message-----
From: SeqFan [mailto:seqfan-bounces at list.seqfan.eu] On Behalf Of israel at math.ubc.ca
Sent: Friday, October 02, 2015 6:27 PM
To: Sequence Fanatics Discussion list
Subject: [seqfan] Re: Rounding in A075465

Harvey:
Would you mind making that modification to your existing Mathematica code in A075465?
Cheers,
Robert

On Oct 2 2015, Harvey P. Dale wrote:

>        It may be of some passing interest that Mathematica's "Round"
> function does not always round down in the case of a tie. Instead, the
> documentation says that "Round rounds numbers of the form x.5 toward
> the nearest even integer." That means (1) that Mathematica rounds up
> or down, in the case of a tie, to whichever is the nearest even
> integer, and (2) that if one wants to control the rounding in
> Mathematica to be consistent one has to write a separate function to
> do it correctly. Best, Harvey
>
>
> -----Original Message----- From: SeqFan
> [mailto:seqfan-bounces at list.seqfan.eu] On Behalf Of Neil Sloane Sent:
> Friday, October 2, 2015 8:08 AM To: Sequence Fanatics Discussion list
> <seqfan at list.seqfan.eu> Subject: [seqfan] Re: Rounding in A075465
>
>Unless Zak responds otherwise, I suggest we add a comment saying:
>
>In case of a tie, round down.
>
>That is consistent with the data, and is the usual convention anyway.
>
>Best regards
>Neil
>
>Neil J. A. Sloane, President, OEIS Foundation.
>11 South Adelaide Avenue, Highland Park, NJ 08904, USA.
>Also Visiting Scientist, Math. Dept., Rutgers University, Piscataway, NJ.
>Phone: 732 828 6098; home page: http://NeilSloane.com
>Email: njasloane at gmail.com
>
>
>On Fri, Oct 2, 2015 at 2:55 AM, <israel at math.ubc.ca> wrote:
>
>> A075465 is "Rounded average of first n primes", but nowhere does it
>> say what type of rounding is used in case of a tie (i.e. when the
>> actual average is half an odd integer). Since the Data gives a(2) =
>> 2,
>> 5/2 is being rounded to 2 rather than 3. That could indicate that
>> ties are rounded down, or that ties are rounded to the nearest even
>> integer. The next places the issue will arise in this sequence are
>> a(1810) (which could be 7265 or
>> 7266) and and a(2458) (10285 or 10286).
>>
>> Cheers, Robert
>>
>> _______________________________________________
>>
>> Seqfan Mailing list - http://list.seqfan.eu/
>>
>
>_______________________________________________
>
>Seqfan Mailing list - http://list.seqfan.eu/
>
>_______________________________________________
>
>Seqfan Mailing list - http://list.seqfan.eu/
>
>

_______________________________________________

Seqfan Mailing list - http://list.seqfan.eu/

_______________________________________________

Seqfan Mailing list - http://list.seqfan.eu/
```