[seqfan] Re: A154676
Maximilian Hasler
maximilian.hasler at gmail.com
Fri Jan 16 04:08:07 CET 2009
Using Zak's observation, it only takes milliseconds to compute
hundreds of terms. Indeed, if N/103 is a square, then N=103*m^2, and
this cannot be the average of a twin prime pair unless m=6k : if m=2
or 4 mod 6 then N-1 = 0 mod 3).
The same applies to sequences A154670-A154675.
(Actually for N=11m² one must even have m=30k, as can be seen from N+/-1 mod 5.)
The corresponding k-values are in A037073 for A154670, for
A154671-A154675 they did not exist until today. (Comments &
cross-references have been added for A154670-A154676.)
The following PARI code confirms your values:
pp=[{...}] /* pasted from your mail */
#pp /* number of terms */
%29 = 285
k=1; mh=vector(#pp,i,until(isprime(3708*k^2+1)&isprime(3708*k^2-1),k++);k^2)*3708;
##
*** last result computed in 172 ms.
if( mh==pp, print("they are the same"))
they are the same
Maximilian
On Thu, Jan 15, 2009 at 9:24 PM, Peter Pein <petsie at dordos.net> wrote:
> zak seidov schrieb:
>> Terms in A154676 are of the form 3708 n^2,
>> and 1262 values of n<10^5 are in
>> http://zak08.livejournal.com/4070.html
>>(...)
> Dear group,
>
> could someone please check, if the following Mathematica-code gives correct
> results. It seems slightly more efficient than that published in OEIS.
> sorry for the unformatted output, but it is nearly 2:30am and I want to go to bed.
> Have a nice day/night/time
> Peter
>
> Timing[lst = {};
> Do[If[PrimeQ[n - 1] &&
> PrimeQ[n + 1],
> If[IntegerQ[Sqrt[n*103]],
> AppendTo[lst, n]]],
> {n, 9!, 2*11!, 6}]; lst]
> Out[1]=
> {139.704731*Second, {2317500, 12047292, 26163648, 43250112, 47347452, 61704828}}
> In[2]:=
> Timing[lst = {}; Do[n = k^2/103;
> If[PrimeQ[n - 1] && PrimeQ[
> n + 1], AppendTo[lst, n]],
> {k, 103, 10300000, 103}]; lst]
> Out[5]=
> {1.096068*Second, {2317500, 12047292,
(...)
> 966171920112, 975411503388,
> 981676095228}}
More information about the SeqFan
mailing list