Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Program to generate more members of the sequence A065978 in http://www.oeis.org/
Replies: 0

 Search Thread: Advanced Search

 Gilmar Rodriguez-pierluissi Posts: 18 Registered: 5/4/11
Program to generate more members of the sequence A065978 in http://www.oeis.org/
Posted: Oct 9, 2013 10:06 PM
 Plain Text Reply

Dear Math Group Gurus:
The following module:

Search[m_, k_] :=
Module[{M}, {M = {};
f[n_] :=
For[p = n/2, True, p--,
If[PrimeQ[p] && PrimeQ[n - p], Return[n - 2 p]]];
For[n = m; max = -1, True, n += 2, If[n > k, Break[]];
If[f[n] > max, AppendTo[M, n]; max = f[n]]]}; M]

generates the list given in:
http://www.oeis.org/A065978/list

For instance;

Timing[Search[4, 4*10^8 ]]

gives:
{76786.2, {4, 8, 16, 44, 92, 242, 256, 272, 292, 476, 530, 572, 682,
688, 1052, 1808, 2228, 3382, 3472, 3502, 3562, 4952, 6194, 7102,
10262, 17008, 20684, 37052, 45128, 49552, 80144, 137414, 251806,
349826, 362534, 742856, 1655152, 1872236, 2108282, 2319728, 2707118,
5182214, 7518328, 10908124, 11939162, 12727966, 13279472, 13583338,
14366372, 18245438, 21572990, 47697614, 54144704, 92661736,
115978712, 366468878}}

My question is; can the above module be modified to give the next member
in this sequence; say a(57), knowing a(56) = 366468878 "apriori"?

In other words; is it possible to get more members of this sequence without
having to start a 4 all the time?

For instance; Mathematica runs out of memory on my PC when I evaluate:
Search[4, 6*10^8]

Grateful to you;
Gilmar Rodriguez Pierluissi
peacenova@yahoo.com

*** Hint: a(57) = 594912044.

© The Math Forum at NCTM 1994-2018. All Rights Reserved.