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.

A238904 Smallest k such that 2^k + (2n+1) and (2n+1)*2^k + 1 are both prime, k <= n, or -1 if no such k exists.

This page as a plain text file.
%I A238904 #9 Mar 15 2014 18:00:53
%S A238904 0,1,1,2,1,1,2,1,-1,6,1,-1,2,2,1,-1,6,1,2,1,1,2,9,-1,2,1,-1,4,2,-1,12,
%T A238904 4,1,2,1,3,6,3,-1,2,1,-1,4,6,9,8,2,1,2,1,3,-1,1,-1,6,1,-1,12,6,3,12,8,
%U A238904 1,2,3,3,4,1,-1,-1,3,-1,-1,60,3,4,2,1,12
%N A238904 Smallest k such that 2^k + (2n+1) and (2n+1)*2^k + 1 are both prime, k <= n, or -1 if no such k exists.
%H A238904 Giovanni Resta, <a href="/A238904/b238904.txt">Table of n, a(n) for n = 0..1000</a>
%e A238904 a(0) = 0 because 2^0 + (2*0+1) = 2 and (2*0+1)*2^0 + 1 = 2 are both prime.
%t A238904 a[n_] := Catch@Block[{k=0}, While[k <= n, If[PrimeQ[2^k + 2*n + 1] && PrimeQ[(2*n + 1)*2^k + 1], Throw@k]; k++]; -1]; a/@ Range[0,80] (* _Giovanni Resta_, Mar 15 2014 *)
%Y A238904 Cf. A046067, A238797.
%K A238904 sign
%O A238904 0,4
%A A238904 _Ilya Lopatin_ and _Juri-Stepan Gerasimov_, Mar 07 2014