login
A069850
Number of distinct primes obtained by inserting a 9 at all possible places in n. This includes prefixing as well as suffixing.
10
1, 1, 0, 0, 1, 0, 2, 1, 0, 1, 2, 0, 2, 1, 0, 0, 2, 0, 2, 0, 0, 1, 2, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 3, 1, 0, 1, 3, 0, 1, 1, 0, 0, 2, 0, 1, 1, 0, 0, 2, 0, 0, 1, 0, 0, 1, 0, 2, 0, 0, 0, 1, 0, 1, 0, 0, 1, 2, 0, 1, 0, 0, 1, 2, 0, 0, 1, 0, 1, 2, 0, 1, 0, 0, 0, 0, 0, 2, 1, 0, 0, 0, 0, 1, 0, 0, 1, 3, 0, 3, 1, 0
OFFSET
1,7
LINKS
EXAMPLE
See the example in A069842.
MAPLE
f:= proc(n) local k;
if member(n mod 10, {0, 2, 4, 5, 6, 8}) then if isprime(10*n+9) then return 1 else return 0 fi fi;
nops(select(isprime, {seq(9*10^k + 10^(k+1)*floor(n/10^k) + (n mod 10^k), k=0..ilog10(n)+1)}));
end proc:
map(f, [$1..200]); # Robert Israel, Oct 09 2020
MATHEMATICA
Table[ Count[ PrimeQ[ Union[ FromDigits /@ Table[ Insert[ IntegerDigits[n], 9, j], {j, 1, Floor[ Log[10, n] + 2]}]]], True], {n, 1, 105}]
KEYWORD
base,nonn
AUTHOR
Amarnath Murthy, Apr 16 2002
EXTENSIONS
More terms from Vladeta Jovovic, Apr 17 2002
Edited by Robert G. Wilson v, Apr 18 2002
STATUS
approved