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.

A322005 Least prime p such that n + p is a Fibonacci number (A000045).

This page as a plain text file.
%I A322005 #14 Dec 15 2018 04:28:43
%S A322005 2,2,3,2,17,3,2,137,5,601,3,2,43,131,7,19,5,17,3,2,967,13,67,11,31,
%T A322005 927372692193078999151,29,7,61,5,59,3,2,577,199,109,19,107,17,571,193,
%U A322005 103,13,101,11,2539,43,97,7,14930303,5,27777890035237,3,2,179,89,6709,10889,31,46309,29,83,6703,547,313,79,23,46301,919,541,19,73,17
%N A322005 Least prime p such that n + p is a Fibonacci number (A000045).
%C A322005 See A322004 for the indices of the corresponding Fibonacci numbers, and further information.
%H A322005 Robert Israel, <a href="/A322005/b322005.txt">Table of n, a(n) for n = 0..1958</a>
%e A322005 a(0) = 2 is the smallest prime p such that p + 0 (= 2) is a Fibonacci number.
%e A322005 a(1) = 2 is the smallest prime p such that p + 1 (= 3) is a Fibonacci number.
%e A322005 a(2) = 3 is the smallest prime p such that p + 2 (= 5) is a Fibonacci number.
%p A322005 f:= proc(n) local p,k,a,b,c;
%p A322005 a:= -n:b:= 1-n:
%p A322005 do
%p A322005   c:= b;
%p A322005   b:= a+b+n;
%p A322005   a:= c;
%p A322005   if isprime(b) then return b fi
%p A322005 od
%p A322005 end proc:
%p A322005 map(f, [$0..80]); # _Robert Israel_, Dec 14 2018
%t A322005 primeQ[n_] := n>0 && PrimeQ[n]; a[n_] := Module[{i=2}, While[!primeQ[Fibonacci[i] - n], i++]; Fibonacci[i] - n]; Array[a, 27, 0] (* _Amiram Eldar_, Dec 12 2018 *)
%o A322005 (PARI) a(n)=for(i=1,oo,ispseudoprime(fibonacci(i)-n)&&return(fibonacci(i)-n))
%Y A322005 Cf. A000040, A000045, A322004.
%K A322005 nonn
%O A322005 0,1
%A A322005 _M. F. Hasler_, Dec 12 2018