|
|
A216231
|
|
Fibonacci with priority for primes: a(0)=0, a(1)=1, for n >= 2, a(n) = a(n-1) + a(k), where 0 < k <= n-2 is maximal index such that a(n-1) + a(k) is prime. If there is no such k, then a(n) = a(n-1) + a(n-2).
|
|
3
|
|
|
0, 1, 1, 2, 3, 5, 7, 12, 19, 31, 43, 74, 79, 153, 227, 239, 313, 552, 631, 643, 1274, 1427, 1979, 3253, 5232, 7211, 7213, 14424, 14737, 15289, 20521, 20533, 41054, 41281, 82335, 83609, 83621, 88853, 90127, 104551, 194678, 201889, 207121, 212353, 226777, 226789
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,4
|
|
COMMENTS
|
Conjecture: There exist arbitrarily long chains of consecutive prime terms.
|
|
LINKS
|
|
|
MAPLE
|
a:= proc(n) option remember; local k;
if n<2 then n
else for k from n-2 to 1 by -1
while not isprime(a(n-1) +a(k)) do od;
a(n-1) +a(`if`(k=0, n-2, k))
fi
end:
|
|
MATHEMATICA
|
a216231[0]:=0;
a216231[1]:=1;
a216231[n_]:=a216231[n]=
Module[{k}, (k=NestWhile[#-1&, n-1, (#>1)&&!PrimeQ[a216231[n-1]+a216231[#]]&];
If[k==1, k=n-2]); a216231[n-1]+a216231[k]];
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|