A133450: correction, more terms, Mmca

Maximilian Hasler maximilian.hasler at gmail.com
Thu Dec 27 14:25:53 CET 2007


Since n^2-1 is never prime but n^2+1 has much better chance of being
prime, the average is much more often less than n^2 and the sum grows
steadily:

(09:10) gp > A056929(i)=i^2-(nextprime(i^2)+precprime(i^2))/2
time = 0 ms.
(09:10) gp > sum(i=1,10^3,A056929(i))
time = 0 ms.
%1 = 168
(09:10) gp > sum(i=1,10^4,A056929(i))
time = 188 ms.
%2 = 1664
(09:10) gp > sum(i=1,10^5,A056929(i))
time = 4,703 ms.
%3 = 19906

On Dec 26, 2007 6:24 PM, Alexander Povolotsky <apovolot at gmail.com> wrote:
> Before submitting sequences I typically run it via superkeeper to
> avoid duplication.
> Obviously the superkeeper is not capable to pick-up cases when one
> sequence is "1/2" (every second term) subset of existing one.
>
> Further, I do have a question related to both A056929 and A133450.
>
> Based on the 100 terms in A133450, calculated by Zak Seidov
> the (so far) running sum of terms is:
>
> 0+1+2+0+1+0+1+2+0+1+1+2+1+4+3-2-2+2+1+1-4-5-5+1+10+1+3+7-2+0+4+0+3-5+4+0+2+12+0-9
> -2+6-6-3+3+0+2+1-3+10-9+1+10-3+1+0+4+2-2+5+1+1+8-12+5-1+8-2+0+0-3-1+1+2+8-4+12
> +3+4+5+1-2-10+0+10+0-6+2+7+9-10+2-1-2-2+0-2+4+0+1= 89 (per 100).
>
> Based on the 87 terms in A056929 the (so far) running sum is:
>
> 0 + 0 + 1 - 1 + 2 - 1 + 0 + 0 + 1 + 1 + 0 - 1 + 1 + 0 + 2 + 1 + 0 - 2
> + 1 + 0 + 1 - 3 + 2 + 0 + 1 - 1 + 4 - 5 + 3 + 1 - 2 + 0 - 2 - 1 + 2 -
> 1 + 1 + 4 + 1 + 0 - 4 - 5 - 5 + 3 - 5 - 1 + 1 - 4 + 10 + 0 + 1 - 2 + 3
> - 5 + 7 + 9 - 2 + 1 + 0 - 2 + 4 - 9 + 0 + 1 + 3 + 1 - 5 - 10 + 4 - 4 +
> 0 + 1 + 2 - 6 + 12 - 4 + 0 + 3 - 9 + 3 - 2 - 2 + 6 + 1 - 6 + 2 - 3 =
> -7 (per 87)
>
> So the question is:
>
> Are squares of integers indeed on average located "more or less" in the
> middle between bounding prime numbers ?
> Are there any reference (currently none listed) to this question subject ?
>
> Alex
> ===========================================================
>
> On Dec 26, 2007 4:26 PM, Maximilian Hasler <maximilian.hasler at gmail.com> wrote:
> > this seq. appears to be just every other term of
> > http://www.research.att.com/~njas/sequences/A056929
> > Difference between n^2 and average of smallest prime greater than n^2
> > and largest prime less than n^2.
> > As such it becomes a bit less interesting in itself (IMHO)...
> >
> > %I A133450
> > %S A133450 0, 1, 2, 0, 1, 0, 1, 2, 0, 1, 1, 2, 1, 4, 3, -2, -2
> > %F A133450 a(n)=A056929(2n)
> > %Y A133450 Cf. A056929
> > %o A133450 (PARI) A133450(n)=4*n^2-(precprime(4*n^2)+nextprime(4*n^2))/2
> > %A A133450 Maximilian F. Hasler (Maximilian.Hasler(AT)gmail.com), Dec 26 2007
> >
> > In order not to mix up Neil's scripts, I resist against puting the
> > obvious PARI code for A056929 in this very same e-mail (just remove
> > the "4*"s) - anyway, that other seq. already has the corresponding
> > Maple code.
> >
> > On Dec 23, 2007 4:32 PM, zak seidov <zakseidov at yahoo.com> wrote:
> > > Neil, Alexander,
> > >
> > > 1.
> > > %e A133450 a(5)=5 because 100 - (89 + 101)/2 = 5
> > > should be
> > > %e A133450 a(5)=1 because 100 - (97 + 101)/2 = 1
> > >
> > > 2.
> > > More terms:
> > >
> > > %S A133450
> > > 0,1,2,0,1,0,1,2,0,1,1,2,1,4,3,-2,-2,2,1,1,-4,-5,-5,1,10,1,3,7,-2,0,4,0,3,-5,4,0,2,12,0,-9,-2,6,-6,-3,3,0,2,1,-3,10,-9,1,10,-3,1,0,4,2,-2,5,1,1,8,-12,5,-1,8,-2,0,0,-3,-1,1,2,8,-4,12,3,4,5,1,-2,-10,0,10,0,-6,2,7,9,-10,2,-1,-2,-2,0,-2,4,0,1
> > >
> > > 3.
> > > Mmca code:
> > > Table[n^2-(Prime[PrimePi[n^2]]+Prime[PrimePi[n^2]+1])/2,{n,2,200,2}]
> > > - Zak Seidov (zakseidov at yahoo.com)
> > >
> >
>



-- 
Maximilian F. Hasler (Maximilian.Hasler(AT)gmail.com)





More information about the SeqFan mailing list