Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #16039 > unrolled thread

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

Started byGilmar Rodriguez-pierluissi <peacenova@yahoo.com>
First post2013-10-10 02:06 +0000
Last post2013-10-10 02:06 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  Program to generate more members of the sequence A065978 in http://www.oeis.org/ Gilmar Rodriguez-pierluissi <peacenova@yahoo.com> - 2013-10-10 02:06 +0000

#16039 — Program to generate more members of the sequence A065978 in http://www.oeis.org/

FromGilmar Rodriguez-pierluissi <peacenova@yahoo.com>
Date2013-10-10 02:06 +0000
SubjectProgram to generate more members of the sequence A065978 in http://www.oeis.org/
Message-ID<l3522a$a71$1@smc.vnet.net>

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.

[toc] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web