login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A346064 Number of primes that may be generated by changing any two digits of n simultaneously. 2
21, 17, 20, 15, 21, 20, 21, 16, 21, 17, 23, 18, 22, 17, 23, 22, 23, 17, 23, 19, 23, 19, 22, 16, 23, 22, 23, 18, 23, 18, 22, 18, 21, 16, 22, 21, 22, 17, 22, 17, 23, 18, 22, 17, 23, 22, 23, 17, 23, 19, 23, 19, 22, 16, 23, 22, 23, 18, 23, 18, 22, 18, 21, 16, 22 (list; graph; refs; listen; history; text; internal format)
OFFSET
10,1
COMMENTS
Indices of low records are given by A345289. By heuristic considerations it is conjectured that a(n) > 0 for all n >= 10.
LINKS
M. Filaseta, M. Kozek, Ch. Nicol and J. Selfridge, Composites that Remain Composite After Changing a Digit, J. Comb. Number Theory, Vol. 2, No. 1 (2010), pp. 25-36.
EXAMPLE
Changing two digits of the number 17 simultaneously yields the primes 02,03,05,23,29,31,41,43,53,59,61,71,73,79,83,89, so a(17) = 16.
MAPLE
A346064 := proc(n)
local a, d, e, r, s, l, N, NN, nn, i;
a := 0;
N := convert(n, base, 10);
l := nops(N);
for d to l - 1 do
for e from d + 1 to l do
for r from 0 to 9 do
for s from 0 to 9 do
if r <> op(d, N) and s <> op(e, N) then
NN := subsop(d = r, e = s, N);
nn := add(op(i, NN)*10^(i - 1), i = 1 .. l);
if isprime(nn) then a := a + 1; end if;
end if;
end do;
end do;
end do;
end do;
a;
end proc:
MATHEMATICA
Table[Count[Flatten[FromDigits/@Tuples[ReplacePart[t=List/@IntegerDigits[n], {#->Complement[Range[0, 9], t[[#]]], #2->Complement[Range[0, 9], t[[#2]]]}]&@@#]&/@Subsets[Range@IntegerLength@n, {2}]], _?PrimeQ], {n, 10, 100}] (* Giorgos Kalogeropoulos, Jul 23 2021 *)
PROG
(Python)
from sympy import isprime
from itertools import combinations, product
def change2(s):
for i, j in combinations(range(len(s)), 2):
for c, d in product("0123456789", repeat=2):
if c != s[i] and d != s[j]:
yield s[:i] + c + s[i+1:j] + d + s[j+1:]
def a(n): return sum(isprime(int(t)) for t in change2(str(n)))
print([a(n) for n in range(10, 101)]) # Michael S. Branicky, Jul 23 2021
CROSSREFS
Cf. A345289 (indices of record lows).
Cf. A209252 (changing one digit).
Sequence in context: A321281 A048933 A142590 * A291469 A105706 A022977
KEYWORD
nonn,base
AUTHOR
Franz Vrabec, Jul 03 2021
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 23 23:26 EDT 2024. Contains 371917 sequences. (Running on oeis4.)