cp's OEIS Frontend

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.

A214878 Least k such that Fibonacci(n) + Fibonacci(n+1) + ... + Fibonacci(n+k-1) is prime.

This page as a plain text file.
%I A214878 #19 Aug 26 2012 11:27:14
%S A214878 3,2,2,1,1,1,5,1,4,2,4,1,5,1,4,2,4,1,5,7,29,2,37,1,11,163,5,2,4,1,5,
%T A214878 73,19,1433,4,13,347,61201,4,47,43,2,41,1,4,2,13,1,131,19,4,5,7,787,
%U A214878 173,31,13,1265,4,11,53
%N A214878 Least k such that Fibonacci(n) + Fibonacci(n+1) + ... + Fibonacci(n+k-1) is prime.
%C A214878 Next term, if it exists, is bigger than 95000.
%e A214878 0+1+1=2, three summands, so a(0)=3,
%e A214878 1+1=2, two summands,
%e A214878 1+2=3, two summands,
%e A214878 2,
%e A214878 3,
%e A214878 5,
%e A214878 8+13+21+34+55=131, five summands, so a(6)=5, and so on.
%t A214878 Table[k = n; p = Fibonacci[k]; While[! PrimeQ[p], k++; p = p + Fibonacci[k]]; k - n + 1, {n, 0, 30}] (* _T. D. Noe_, Jul 30 2012 *)
%o A214878 (Java)
%o A214878 import static java.lang.System.out;
%o A214878 import java.math.BigInteger;
%o A214878 public class A214878 {
%o A214878   public static void main (String[] args) {
%o A214878     BigInteger prpr=BigInteger.ZERO, prpr0;
%o A214878     BigInteger prev=BigInteger.ONE, prev0, curr, sum, prevSum;
%o A214878     long i, n;
%o A214878     for (n=0; ; ++n) {
%o A214878       prpr0 = prpr;
%o A214878       prev0 = prev;
%o A214878       sum = BigInteger.ZERO;
%o A214878       for (i=n; ; ++i) {
%o A214878         sum = sum.add(prpr);
%o A214878         if (sum.isProbablePrime(2)) {
%o A214878           if (sum.isProbablePrime(80)) break;
%o A214878         }
%o A214878         curr = prev.add(prpr);
%o A214878         prpr = prev;
%o A214878         prev = curr;
%o A214878       }
%o A214878       out.printf("%d, ", i+1-n);
%o A214878       prpr = prev0;
%o A214878       prev = prev0.add(prpr0);
%o A214878     }
%o A214878   }
%o A214878 }
%Y A214878 Cf. A000040, A000045, A214874.
%K A214878 nonn,hard,more
%O A214878 0,1
%A A214878 _Alex Ratushnyak_, Jul 29 2012
%E A214878 a(37)-a(60) from _T. D. Noe_, Jul 30 2012