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.

A257378 Smallest odd number k such that k*n*2^n+1 is a prime number.

This page as a plain text file.
%I A257378 #27 Jan 06 2016 15:52:56
%S A257378 1,5,3,3,13,3,3,9,5,13,9,3,3,5,9,7,3,3,3,5,3,7,19,5,5,33,3,7,7,9,5,15,
%T A257378 3,21,15,7,35,89,25,15,25,49,53,45,13,15,21,31,27,3,9,33,37,23,41,41,
%U A257378 19,9,111,7,3,89,13,39,31,17,11,101,17,37,7,51,75
%N A257378 Smallest odd number k such that k*n*2^n+1 is a prime number.
%C A257378 Conjecture: a(n) exists for every n.
%C A257378 The conjecture is a corollary of Dirichlet's theorem on primes in arithmetic progressions. - _Robert Israel_, Jan 05 2016
%C A257378 As N increases sum {k, n=1 to N} / sum {n, n=1 to N} tends to 0.818.
%C A257378 If k=1 then n*2^n+1 is a Cullen prime.
%C A257378 Generalized Cullen primes have the form n*b^n+1, I propose to name the primes k*n*2^n-1 generalized Cullen primes of the second type.
%H A257378 Pierre CAMI, <a href="/A257378/b257378.txt">Table of n, a(n) for n = 1..10000</a>
%e A257378 1*1*2^1+1=3 prime so a(1)=1.
%e A257378 1*2*2^2+1=9 composite, 3*2*2^2+1=25 composite, 5*2*2^2+1=41 prime so a(2)=5.
%e A257378 1*3*2^3+1=25 composite, 3*3*2^3=73 prime so a(3)=3.
%p A257378 Q:= proc(m) local k;
%p A257378   for k from 1 by 2 do if isprime(k*m+1) then return k fi od
%p A257378 end proc: seq(Q(n*2^n), n=1..100); # _Robert Israel_, Jan 05 2016
%t A257378 Table[k = 1; While[!PrimeQ[k*n*2^n + 1], k += 2]; k, {n, 73}] (* _Michael De Vlieger_, Apr 21 2015 *)
%o A257378 (PFGW & SCRIPT)
%o A257378 SCRIPT
%o A257378 DIM n,0
%o A257378 DIM k
%o A257378 DIMS t
%o A257378 OPENFILEOUT myf,a(n).txt
%o A257378 LABEL loop1
%o A257378 SET n,n+1
%o A257378 IF n>3000 THEN END
%o A257378 SET k,-1
%o A257378 LABEL loop2
%o A257378 SET k,k+2
%o A257378 SETS t,%d,%d\,;n;k
%o A257378 PRP k*n*2^n+1,t
%o A257378 IF ISPRP THEN GOTO a
%o A257378 GOTO loop2
%o A257378 LABEL a
%o A257378 WRITE myf,t
%o A257378 GOTO loop1
%o A257378 (PARI) a(n) = k=1; while(!isprime(k*n*2^n+1), k+=2); k \\ _Colin Barker_, Apr 21 2015
%o A257378 (PFGW) ABC2 $b*$a*2^$a+1 // {number_primes,$b,1}
%o A257378 a: from 1 to 10000
%o A257378 b: from 1 to 100000 step 2
%o A257378 _Charles R Greathouse IV_, Apr 24 2015
%Y A257378 Cf. A256787, A257379, A266909.
%K A257378 nonn
%O A257378 1,2
%A A257378 _Pierre CAMI_, Apr 21 2015