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.

A253398 Smallest odd k > 1 such that k*2^prime(n) + 1 is prime.

This page as a plain text file.
%I A253398 #24 Mar 02 2019 03:00:36
%S A253398 3,5,3,5,9,5,9,11,45,23,35,15,3,9,27,51,27,53,9,39,23,249,51,51,131,
%T A253398 221,29,105,321,179,5,221,111,411,191,65,83,75,95,101,147,83,149,111,
%U A253398 203,131,9,245,281,15,83,65,299
%N A253398 Smallest odd k > 1 such that k*2^prime(n) + 1 is prime.
%C A253398 For n < 1275, the ratio a(n)/prime(n) is always < 6 and on average ~0.7.
%C A253398 From _Robert G. Wilson v_, Jan 27 2015: (Start)
%C A253398 Records: 3, 5, 9, 11, 45, 51, 53, 249, 321, 411, 611, 1383, 1875, 2423, 4239, 4623, 6549, 7095, 8091, 9003, 10065, 10719, 18005, 18545, 19251, 21111, 25409, 39741, 49709, 54455, ..., .
%C A253398 a(n)=3 for n = 1, 3, 13, 71, ...;
%C A253398 a(n)=5 for n = 2, 4, 6, 31, 466, ...;
%C A253398 a(n)=9 for n = 5, 7, 14, 19, 47, 342, 1167, ...;
%C A253398 a(n)=11 for n = 8, ...; etc.
%C A253398 (End)
%H A253398 Robert G. Wilson v, <a href="/A253398/b253398.txt">Table of n, a(n) for n = 1..1500</a> (first 1275 terms from Pierre CAMI)
%F A253398 a(n) = A247479(p_n). - _Robert G. Wilson v_, Jan 27 2015
%e A253398 3*2^2 + 1 = 13 (prime), so a(1)=3.
%e A253398 3*2^3 + 1 = 25 (composite), 5*2^3 + 1 = 41 (prime), so a(2)=5.
%e A253398 3*2^5 + 1 = 97 (prime), so a(3)=3.
%t A253398 f[n_] := Block[{k = 3, p = 2^Prime@ n}, While[ !PrimeQ[ k*p + 1], k += 2]; k]; Array[f, 53] (* _Robert G. Wilson v_, Jan 25 2015 *)
%o A253398 (PFGW & SCRIPT)
%o A253398 SCRIPT
%o A253398 DIM i,0
%o A253398 DIM j
%o A253398 OPENFILEOUT myf,a(n).txt
%o A253398 LABEL loop1
%o A253398 SET i,i+1
%o A253398 SET j,1
%o A253398 LABEL loop2
%o A253398 SET j,j+2
%o A253398 PRP j*2^p(i)+1
%o A253398 IF ISPRP THEN WRITE myf,k
%o A253398 IF ISPRP THEN GOTO loop1
%o A253398 GOTO loop2
%o A253398 (PARI) a(n)=k=1;while(!isprime((2*k+1)*2^prime(n)+1),k++);2*k+1
%o A253398 vector(100,n,a(n)) \\ _Derek Orr_, Dec 31 2014
%Y A253398 Cf. A247479, A253027.
%K A253398 nonn
%O A253398 1,1
%A A253398 _Pierre CAMI_, Dec 31 2014