|
|
A225504
|
|
a(n) = prime((a(n-1) + a(n-2)) / 2) for n>1, with a(0) = 3, a(1) = 5.
|
|
1
|
|
|
3, 5, 7, 13, 29, 73, 233, 883, 4049, 22013, 140269, 1036183, 8771489, 84270997, 910550899, 10977409981, 146618640533, 2155882170713, 34701120973507, 608312884303213, 11560371513545909, 237170393590520353, 5232858369551752099, 123736201926723358439
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,1
|
|
LINKS
|
|
|
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
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|