A271630 Composite numbers n coprime to all number that can be obtained by changing just one digit of n.
121, 143, 169, 187, 209, 221, 247, 253, 289, 299, 319, 323, 341, 343, 361, 377, 391, 403, 407, 437, 451, 473, 481, 493, 517, 527, 529, 533, 551, 553, 559, 583, 589, 611, 629, 649, 667, 671, 689, 697, 703, 713, 731, 737, 767, 779, 781, 793, 799, 803, 817, 841, 851
Offset: 1
Examples
343 is coprime to: 43, 143, 243, 443, 543, 643, 743, 843, 943 (where the MSD has been changed); 303, 313, 323, 333, 353, 363, 373, 383, 393 (where the '4' in the middle has been changed); 340, 341, 342, 344, 345, 346, 347, 348, 349 (where the LSD has been changed) .
Links
- Paolo P. Lava, Table of n, a(n) for n = 1..10000
- Paolo P. Lava, First 500 palindromes in the sequence
- Paolo P. Lava, First 10000 non palindromes whose reverses are terms of the sequence
Programs
-
Maple
with(numtheory); P:=proc(q) local a,j,k,n,ok; for n from 2 to q do if not isprime(n) then ok:=1; j:=0; while ok=1 and j<9 do j:=j+1; for k from 1 to ilog10(n)+1 do a:=trunc(n/10^k)*10^k+((trunc((n mod 10^k)/10^(k-1))-j) mod 10)*10^(k-1)+(n mod 10^(k-1)); if gcd(n,a)>1 then ok:=0; break; fi; od; od; if ok=1 then print(n); fi; fi; od; end: P(10^5);
-
Mathematica
Select[Range[10^3], Function[n, And[CompositeQ@ n, AllTrue[Flatten@ Function[w, Map[Function[k, Map[FromDigits[ReplacePart[w, k -> #]] &, Range[0, 9]]], Range@ Length@ w] /. m_ /; m == n -> Nothing]@ IntegerDigits@ n, CoprimeQ[#, n] &]]]] (* Michael De Vlieger, Apr 15 2016 *)
Comments