login
a(n) = smallest number k such that 2*(k*n)^n-1 is prime, or 0 if no such k exists.
1

%I #17 Apr 25 2016 11:50:03

%S 2,1,1,2,2,6,3,6,3,2,5,18,22,11,5,15,30,2,34,4,52,9,27,6,30,21,14,4,

%T 14,18,18,68,60,107,81,95,193,16,111,98,2,22,97,23,9,47,24,38,166,81,

%U 29,95,98,44,235,5,2,199,705,143,417,21,42

%N a(n) = smallest number k such that 2*(k*n)^n-1 is prime, or 0 if no such k exists.

%C All primes 2*(a(n)*n)^n-1 are certified primes for n=1 to 1500.

%C I conjecture that k exists for every n.

%C As N increases the ratio (sum k for n=1 to N)/(sum n for n=1 to N ) tends to 4.11, so in average k~4.1*n.

%C From _Robert G. Wilson v_, Sep 16 2014: (Start)

%C First appearance of k or 0 if not yet present: 2, 1, 7, 20, 11, 6, 78, 0, 22, 111, 14, 279, 0, 27, 16, …, .

%C Increasingly larger terms (records): 2, 6, 18, 22, 30, 34, 52, 68, 107, 193, 235, 705, 1691, 1898, 2150, 2157, 4766, 5654, 9681, 9897, 18384, 18873, 22885, 31044, 31284, 37180, 37935, …, .

%C Increasingly larger terms (records) by index: 1, 6, 12, 13, 17, 19, 21, 32, 34, 37, 55, 59, 83, 126, 144, 184, 197, 227, 371, 427, 433, 751, 775, 827, 1121, 1201, 1403, …, . (End)

%H Pierre CAMI, <a href="/A246402/b246402.txt">Table of n, a(n) for n = 1..1515</a>

%e 2*(2*1)^1-1=3 prime so a(1)=2.

%e 2*(1*2)^2-1=7 prime so a(2)=1.

%t f[n_] := Block[{k = 1}, While[ !PrimeQ[ 2(k*n)^n - 1], k++]; k]; Array[f, 100] (* _Robert G. Wilson v_, Sep 16 2014 *)

%o (PFGW & SCRIPT)

%o SCRIPT

%o DIM k

%o DIM n,0

%o OPENFILEOUT myf,a(n).txt

%o LABEL loop1

%o SET n,n+1

%o SET k,0

%o LABEL loop2

%o SET k,k+1

%o PRP 2*(k*n)^n-1,t

%o IF ISPRP then GOTO a

%o GOTO loop2

%o LABEL a

%o WRITE myf,k

%o GOTO loop1

%o (PARI) a(n) = k=1; while(!ispseudoprime(2*(k*n)^n-1), k++); k \\ _Colin Barker_, Aug 25 2014

%K nonn

%O 1,1

%A _Pierre CAMI_, Aug 25 2014