OFFSET
0,1
MATHEMATICA
nxt[{a_, b_}] := {b, Prime[(a + b)/2]}; Transpose[NestList[nxt, {3, 5}, 17]][[1]] (* The program generates only the first 18 terms of the sequence; the 19th term is too large for Mathematica to generate it *) (* Harvey P. Dale, Apr 24 2016 *)
PROG
(C)
#include <stdio.h>
#define TOP (1ULL<<32)
typedef unsigned long long U64;
int main() {
U64 i, j, p = 2, prpr = 3, prev = 5;
unsigned int *primes = (unsigned int*)malloc(TOP/4);
char *c = (char*)malloc(TOP/2);
memset(c, 0, TOP/2);
for (primes[1] = 2, i = 3; i < TOP; i+=2)
if (c[i>>1]==0)
for (primes[p++]=i, j=i*i>>1; j<TOP/2; j+=i) c[j]=1;
for (printf("3, 5, "); (prev+prpr)/2<p; prpr=prev, prev=i)
i = primes[(prev+prpr)/2], printf("%llu, ", i);
}
CROSSREFS
KEYWORD
nonn,hard,more
AUTHOR
Alex Ratushnyak, May 09 2013
EXTENSIONS
a(15)-a(18) from Max Alekseyev, Jan 30 2014
a(19)-a(23) from Jinyuan Wang, Nov 14 2020
STATUS
approved