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.

A102632 Smallest k such that at least one of 2^k+/-prime(n) is prime.

This page as a plain text file.
%I A102632 #5 Mar 14 2015 16:53:23
%S A102632 0,1,1,2,1,2,1,2,3,1,4,2,1,2,5,3,1,6,2,1,4,2,7,3,2,1,2,1,2,7,2,3,1,9,
%T A102632 1,4,4,2,5,3,1,4,1,2,1,6,4,2,1,2,3,1,4,5,9,3,1,9,2,1,6,7,2,1,2,5,4,4,
%U A102632 1,2,16,3,4,4,2,10,3,2,3,9,1,8,1,4,2,7,3,2,1,2,5,3,2,3,2,7,5,1,6,4,4,9,3,1
%N A102632 Smallest k such that at least one of 2^k+/-prime(n) is prime.
%H A102632 Lei Zhou, <a href="http://www.bme.emory.edu/~lzhou/prime/">Between 2^n and primes</a>.
%e A102632 For prime(2)=3, 2^1+3 = 5 is prime
%e A102632 For prime(18)=61, 2^6-61 = 3 is prime
%t A102632 f[n_] := Block[{k = 0, p = Prime[n]}, While[ Not[(2^k - p > 1 && PrimeQ[2^k - p]) || PrimeQ[2^k + p]], k++ ]; k]; Table[ f[n], {n, 104}] (* _Robert G. Wilson v_, Jan 22 2005 *)
%Y A102632 Cf. A102930, A102931, A094076, first occurrence in A103032.
%K A102632 nonn
%O A102632 1,4
%A A102632 _Lei Zhou_, Jan 20 2005
%E A102632 More terms from _Robert G. Wilson v_, Jan 21 2005