A271630
Composite numbers n coprime to all number that can be obtained by changing just one digit of n.
Original entry on oeis.org
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
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) .
-
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);
-
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 *)
A345356
Numbers k coprime to 30 such that ceiling(sqrt(k))^2 - k is a square.
Original entry on oeis.org
1, 49, 77, 91, 121, 143, 169, 187, 209, 221, 247, 289, 299, 323, 361, 391, 437, 493, 529, 551, 589, 667, 713, 841, 851, 899, 961, 1073, 1147, 1189, 1247, 1271, 1333, 1369, 1457, 1517, 1591, 1681, 1739, 1763, 1813, 1849, 1927, 1961, 2009, 2021
Offset: 1
For k=77, ceiling(sqrt(k)) is 9, so we evaluate 9^2 - 77 = 4, which is a square, so 77 is a term.
Let k=97, 100 - 97 = 3 is not a square and is not a term.
-
Select[Range[2000], CoprimeQ[#, 30] && IntegerQ @ Sqrt[Ceiling[Sqrt[#]]^2 - #] &] (* Amiram Eldar, Jun 23 2021 *)
-
genit(minn=1,maxx)={arr=List();forstep(w=minn,maxx,2,if(w%5==0||w%6==3,next);z=sqrtint(w-1)+1;if(issquare(z^2-w)>0,listput(arr,w);next));arr}
A348394
Primes preceding record runs of composites coprime to 30 (A007775).
Original entry on oeis.org
7, 47, 113, 317, 523, 1327, 9551, 15683, 19609, 25471, 31397, 155921, 360653, 370261, 1349533, 1357201, 2010733, 4652353, 17051707, 20831323, 47326693, 122164747, 189695659, 191912783, 387096133, 1294268491, 1453168141, 2300942549, 3842610773, 4302407359, 10726904659, 20678048297, 22367084959, 25056082087, 42652618343, 127976334671, 182226896239
Offset: 1
The next number coprime to 30 after 7 is 11, giving a run of 0 composites.
47 is followed by 49 = 7^2 and 53 (prime), a run of 1 composite.
113 is followed by 119 = 7*17, 121 = 11^2, and 127 (prime), a run of 2 composites.
The first few entries correspond to the following table. The table contains the order in which record composites occur (n), the number of composites between successive primes (gap size), the prime preceding the record composites (1st prime), the prime following the record composites (2nd prime) and the merit of the gap (merit) rounded to 4 decimals. The merit is the gap size divided by the natural log of the 1st prime (gap size / log(1st prime)).
n gap size 1st prime 2nd prime gap merit
1, 0, 7, 11, 0.0000
2, 1, 47, 53, 0.2597
3, 2, 113, 127, 0.4231
4, 3, 317, 331, 0.5209
5, 4, 523, 541, 0.6390
6, 8, 1327, 1361, 1.1126
7, 9, 9551, 9587, 0.9821
8, 10, 15683, 15727, 1.0352
9, 12, 19609, 19661, 1.2141
10, 13, 25471, 25523, 1.2814
11, 18, 31397, 31469, 1.7384
12, 22, 155921, 156007, 1.8399
13, 24, 360653, 360749, 1.8756
...
38, 125, 182226896239, 182226896713, 4.8209
-
Block[{m = Select[Range[29], CoprimeQ[#, 30] &], s, t}, s = Reap[Array[Map[If[! PrimeQ[#], Sow[#]] &, 30 # + m] &, 2^20]][[-1, -1]]; Set[{s, t}, Transpose@ #] &@ Tally@ Array[NextPrime[s[[#]], -1] &, Length@ s]; Map[s[[FirstPosition[t, #][[1]]]] &, Union@ FoldList[Max, t]] ] (* Michael De Vlieger, Oct 25 2021 *)
-
isok(x) = vecsearch([1, 7, 11, 13, 17, 19, 23, 29], x%30);
nbc(n, v) = {my(i=n+1, c= v[i], nb=0); while(!isprime(c), nb++; i++; if (i>#v, return(-1)); c = v[i]); nb;}
lista(nn) = {my(v = [2..nn], m=-1, nb); v = select(x->isok(x), v); v = apply(isprime, v); for (n=1, #v-1, if (isprime(v[n]), nb = nbc(n, v); if (nb==-1, break); if (nb > m, print1(v[n], ", "); m = nb);););} \\ Michel Marcus, Oct 21 2021
Showing 1-3 of 3 results.
Comments