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.

A247202 Smallest odd k > 1 such that k*2^n - 1 is a prime number.

This page as a plain text file.
%I A247202 #42 Aug 07 2023 05:21:41
%S A247202 3,3,3,3,7,3,3,5,7,5,3,5,9,5,9,17,7,3,51,17,7,33,13,39,57,11,21,27,7,
%T A247202 213,15,5,31,3,25,17,21,3,25,107,15,33,3,35,7,23,31,5,19,11,21,65,147,
%U A247202 5,3,33,51,77,45,17,69,53,9,3,67,63,43,63,51,27,73,5
%N A247202 Smallest odd k > 1 such that k*2^n - 1 is a prime number.
%C A247202 Limit_{N->oo} (Sum_{n=1..N} a(n))/(Sum_{n=1..N} n) = log(2). [[Is there a proof or is this a conjecture? - _Peter Luschny_, Feb 06 2015]]
%C A247202 Records: 3, 7, 9, 17, 51, 57, 213, 255, 267, 321, 615, 651, 867, 901, 909, 1001, 1255, 1729, 1905, 2163, 3003, 3007, 3515, 3797, 3825, 4261, 4335, 5425, 5717, 6233, 6525, 6763, 11413, 11919, 12935, 20475, 20869, 25845, 30695, 31039, 31309, 42991, 55999, ... . - _Robert G. Wilson v_, Feb 08 2015
%H A247202 Robert G. Wilson v, <a href="/A247202/b247202.txt">Table of n, a(n) for n = 1..10031</a> (first 5000 terms from Pierre CAMI)
%F A247202 a(A002235(n)) = 3.
%p A247202 f:= proc(n)
%p A247202 local k,p;
%p A247202   p:= 2^n;
%p A247202 for k from 3 by 2 do if isprime(k*p-1) then return k fi od;
%p A247202 end proc:
%p A247202 seq(f(n), n=1 .. 100); # _Robert Israel_, Feb 05 2015
%t A247202 f[n_] := Block[{k = 3, p = 2^n}, While[ !PrimeQ[k*p - 1], k += 2]; k]; Array[f, 70]
%o A247202 (PFGW & SCRIPT)
%o A247202 SCRIPT
%o A247202 DIM k
%o A247202 DIM n,0
%o A247202 DIMS t
%o A247202 OPENFILEOUT myf,a(n).txt
%o A247202 LABEL loop1
%o A247202 SET n,n+1
%o A247202 SET k,1
%o A247202 LABEL loop2
%o A247202 SET k,k+2
%o A247202 SETS t,%d,%d\,;n;k
%o A247202 PRP k*2^n-1,t
%o A247202 IF ISPRP THEN GOTO a
%o A247202 GOTO loop2
%o A247202 LABEL a
%o A247202 WRITE myf,t
%o A247202 GOTO loop1
%o A247202 (PARI) a(n) = {k=3; while (!isprime(k*2^n-1), k+=2); k;} \\ _Michel Marcus_, Nov 25 2014
%Y A247202 Cf. A126715, A247479.
%K A247202 nonn
%O A247202 1,1
%A A247202 _Pierre CAMI_, Nov 25 2014