login
Array A(n, k) read by antidiagonals downwards: k-th base-n non-repunit prime p such that all numbers resulting from switching any two adjacent digits in the base-n representation of p are prime, where k runs over the positive integers, i.e., the offset of k is 1.
0

%I #5 Nov 09 2018 18:30:11

%S 11,191,2,223,5,2,227,7,3,2,2111,17,7,3,2,3847,31,13,7,3,2,229631,41,

%T 23,11,5,3,2,246271,53,29,13,11,5,3,2,262111,157,47,17,31,11,5,3,2,

%U 786431,229,53,19,47,13,7,5,3,2,1046527,239,101,23,71,17,13,7,5

%N Array A(n, k) read by antidiagonals downwards: k-th base-n non-repunit prime p such that all numbers resulting from switching any two adjacent digits in the base-n representation of p are prime, where k runs over the positive integers, i.e., the offset of k is 1.

%C Conjecture: All rows of the array are infinite.

%C If the above conjecture is false, then this should have keyword "tabf" rather than "tabl".

%C Row n is a supersequence of the base-n non-repunit absolute primes. For example, row 10 (A107845) is a supersequence of the decimal non-repunit absolute primes (A129338).

%e The base-3 representation of 251 is 100022. Base-3 numbers that can be obtained by switching any two adjacent base-3 digits are 10022 and 100202. These two numbers are 89 and 263, respectively, when converted to decimal, and both 89 and 263 are prime. Since 251 is the 12th number with this property in base 3, A(3, 12) = 251.

%e Array starts

%e 11, 191, 223, 227, 2111, 3847, 229631, 246271, 262111, 786431, 1046527, 1047551

%e 2, 5, 7, 17, 31, 41, 53, 157, 229, 239, 241, 251

%e 2, 3, 7, 13, 23, 29, 47, 53, 101, 127, 149, 151

%e 2, 3, 7, 11, 13, 17, 19, 23, 43, 131, 281, 311

%e 2, 3, 5, 11, 31, 47, 71, 83, 103, 107, 151, 191

%e 2, 3, 5, 11, 13, 17, 19, 23, 29, 37, 41, 43

%e 2, 3, 5, 7, 13, 29, 31, 41, 43, 47, 59, 61

%e 2, 3, 5, 7, 11, 13, 17, 19, 23, 37, 43, 47

%e 2, 3, 5, 7, 13, 17, 31, 37, 71, 73, 79, 97

%e 2, 3, 5, 7, 13, 17, 19, 23, 29, 31, 37, 43

%e 2, 3, 5, 7, 11, 17, 61, 67, 71, 89, 137, 163

%o (PARI) switchdigits(v, pos) = my(vt=v[pos]); v[pos]=v[pos+1]; v[pos+1]=vt; v

%o decimal(v, base) = my(w=[]); for(k=0, #v-1, w=concat(w, v[#v-k]*base^k)); sum(i=1, #w, w[i])

%o is(p, base) = my(db=digits(p, base)); if(vecmin(db)==1 && vecmax(db)==1, return(0)); for(k=1, #db-1, my(x=decimal(switchdigits(db, k), base)); if(!ispseudoprime(x), return(0))); 1

%o array(n, k) = for(x=2, n+1, my(i=0); forprime(p=1, , if(is(p, x), print1(p, ", "); i++); if(i==k, print(""); break)))

%o array(6, 10) \\ print initial 6 rows and 10 columns of array

%Y Cf. A107845 (row 10), A129338.

%K nonn,tabl,base

%O 2,1

%A _Felix Fröhlich_, Jan 24 2018