login
Numbers k such that appending k to the k-th nonprime yields a prime.
0

%I #15 Dec 24 2018 04:03:21

%S 3,7,9,19,23,41,43,53,57,59,63,67,97,141,147,177,221,237,239,251,281,

%T 289,291,299,313,333,339,343,363,367,373,379,383,449,457,459,463,467,

%U 489,497,503,507,527,529,539,547,563,569,579,583,597,599,601,603,607

%N Numbers k such that appending k to the k-th nonprime yields a prime.

%C Previous title: "Numbers n if concatenation of n-th nonprime and n = prime."

%C Indices n such that the concatenation A141468(n)//n yields a prime. - _R. J. Mathar_, Jan 12 2009

%e Since 4=nonprime(3) and 43 is prime, 3 is in this sequence.

%e Since 10=nonprime(7) and 107 is prime, 7 is in this sequence.

%e Since 14=nonprime(9) and 149 is prime, 9 is in this sequence.

%e Since 27=nonprime(23) and 3323 is prime, 23 is in this sequence.

%e Since 56=nonprime(41) and 5641 is prime, 41 is in this sequence, etc.

%e The sequence A141468 concatenated with the positive nonzero integers begins 1, 12, 43, 64, 85, 96, 107, 128, 149, 1510, 1611, ... Among these terms, 43, 107, and 149 are primes, so 3, 7, and 9 are in this sequence. - _Charlie Neder_, Dec 23 2018

%p A141468 := proc(n) option remember ; local a; if n <=2 then n-1 ; else for a from procname(n-1)+1 do if not isprime(a) then RETURN(a) ; fi; od: fi; end: cat2 := proc(a,b) local d; d := max(1,ilog10(b)+1) ; a*10^d+b ; end: for n from 1 to 1000 do p := cat2( A141468(n),n) ; if isprime(p) then printf("%d,",n ) ; fi; od: # _R. J. Mathar_, Jan 12 2009

%Y Cf. A000040, A141468.

%K nonn,base,less

%O 1,1

%A _Juri-Stepan Gerasimov_, Jan 11 2009

%E Extended by _R. J. Mathar_, Jan 12 2009

%E Title corrected by _Charlie Neder_, Dec 23 2018