login
Numbers n such that replacing any single decimal digit d with d/3 produces a prime (obviously n can contain only digits 3, 6 or 9).
0

%I #11 Jan 23 2016 23:10:14

%S 6,9,33,63,633

%N Numbers n such that replacing any single decimal digit d with d/3 produces a prime (obviously n can contain only digits 3, 6 or 9).

%e 633 belongs to this sequence because 631, 613 and 233 are all prime.

%t Select[FromDigits /@ Flatten[Map[Tuples[{3, 6, 9}, #] &, Range@ 3], 1], Function[n, AllTrue[Function[k, FromDigits@ MapAt[#/3 &, k, #] & /@ Range@ Length@ k]@ IntegerDigits@ n, And[PrimeQ@ #, # != n] &]]] (* _Michael De Vlieger_, Jan 20 2016, Version 10 *)

%Y Cf. A008585.

%K nonn,base,fini,full

%O 1,1

%A _Arkadiusz Wesolowski_, Jan 19 2016