This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A216231 #36 Feb 07 2025 09:26:24 %S A216231 0,1,1,2,3,5,7,12,19,31,43,74,79,153,227,239,313,552,631,643,1274, %T A216231 1427,1979,3253,5232,7211,7213,14424,14737,15289,20521,20533,41054, %U A216231 41281,82335,83609,83621,88853,90127,104551,194678,201889,207121,212353,226777,226789 %N 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). %C A216231 Conjecture: There exist arbitrarily long chains of consecutive prime terms. %C A216231 Agrees with the lower matching number of the n-Fibonacci cube graph from n = 1 to at least n = 9. - _Eric W. Weisstein_, Feb 07 2025 %H A216231 Peter J. C. Moses, <a href="/A216231/b216231.txt">Table of n, a(n) for n = 0..9999</a> %p A216231 a:= proc(n) option remember; local k; %p A216231 if n<2 then n %p A216231 else for k from n-2 to 1 by -1 %p A216231 while not isprime(a(n-1) +a(k)) do od; %p A216231 a(n-1) +a(`if`(k=0, n-2, k)) %p A216231 fi %p A216231 end: %p A216231 seq(a(n), n=0..100); # _Alois P. Heinz_, Mar 14 2013 %t A216231 a216231[0]:=0; %t A216231 a216231[1]:=1; %t A216231 a216231[n_]:=a216231[n]= %t A216231 Module[{k},(k=NestWhile[#-1&,n-1,(#>1)&&!PrimeQ[a216231[n-1]+a216231[#]]&]; %t A216231 If[k==1,k=n-2]);a216231[n-1]+a216231[k]]; %t A216231 Table[a216231[n],{n,0,100}] (* _Peter J. C. Moses_, Mar 14 2013 *) %Y A216231 Cf. A000045. %K A216231 nonn %O A216231 0,4 %A A216231 _Vladimir Shevelev_, Mar 14 2013