A282690
a(n) is the smallest number m, such that m+n is the next prime and m-n is the previous prime.
Original entry on oeis.org
4, 5, 26, 93, 144, 53, 120, 1839, 532, 897, 1140, 211, 2490, 2985, 4312, 5607, 1344, 9569, 30612, 19353, 16162, 15705, 81486, 16787, 31932, 19635, 35644, 82101, 44322, 43361, 34092, 89721, 162176, 134547, 173394, 31433, 404634, 212739, 188068, 542643, 265662
Offset: 1
For n = 6, a(6) = 53, because the next prime after 53 is 59 and the previous prime before 53 is 47, where both have an equal distance of 6 from 53, which is the smallest number with this property.
-
Table[k = 1; While[Nand[k - n == NextPrime[k, -1], k + n == NextPrime@ k], k++]; k, {n, 41}] (* Michael De Vlieger, Feb 20 2017 *)
-
use ntheory qw(:all);
for (my $k = 1 ; ; ++$k) {
for (my $n = 1 ; ; ++$n) {
my $p = prev_prime($n) || next;
my $q = next_prime($n);
if ($n-$p == $k and $q-$n == $k) {
printf("%s %s\n", $k, $n);
last;
}
}
}
A282687
a(n) = strictly increasing number m, such that m+n is the next prime and m-n is the previous prime.
Original entry on oeis.org
4, 5, 26, 93, 144, 157, 300, 1839, 1922, 3099, 3240, 4189, 5544, 5967, 6506, 10815, 11760, 12871, 30612, 33267, 35002, 36411, 81486, 86653, 95676, 103263, 106060, 153219, 181332, 189097, 190440, 288615, 294596, 326403, 399318, 507253, 515004, 570291, 642320
Offset: 1
For n = 5, a(5) = 144, because the next prime after 144 is 149 and the previous prime before 144 is 139, where both have an equal distance of 5 from 144.
-
a = {}; Do[If[n == 1, k = 1, k = Max@ a + 1]; While[Nand[k - n == NextPrime[k, -1], k + n == NextPrime@ k], k++]; AppendTo[a, k], {n, 41}]; a (* Michael De Vlieger, Feb 20 2017 *)
-
use ntheory qw(:all);
for (my ($n, $k) = (1, 1) ; ; ++$n) {
my $p = prev_prime($n) || next;
my $q = next_prime($n);
if ($n-$p == $k and $q-$n == $k) {
printf("%s %s\n", $k++, $n);
}
}
A382110
Smallest number k such that k-n and k+n are consecutive primes and k has exactly n distinct prime factors.
Original entry on oeis.org
4, 15, 154, 3045, 22386, 2467465, 3015870, 368961285, 6326289970, 2313524242029, 1568018377380, 5808562826801735, 1575649493651310, 6177821212870783905, 171718219950879367766, 2039004035049368722335, 13156579658122684173390, 112733682549950000276753015
Offset: 1
a(1) = 4, because 4 - 1 = 3 and 4 + 1 = 5 are two consecutive primes and omega(4) = 1.
a(2) = 15, because 15 - 2 = 13 and 15 + 2 = 17 are two consecutive primes and omega(15) = 2.
-
Do[k=0;Until[PrimeQ[k-n]&&NextPrime[k-n]==k+n&&PrimeNu[k]==n,k++];a[n]=k,{n,7}];Array[a,7] (* James C. McMahon, Mar 20 2025 *)
-
list(len) = {my(v = vector(len), prv = 3, c = 0, d); forprime(p = 5, , d = (p-prv)/2; if(d <= len && v[d] == 0 && omega(prv+d) == d, c++; v[d] = prv + d; if(c == len, break)); prv = p); v;} \\ Amiram Eldar, Mar 18 2025
-
generate(A, B, n) = A=max(A, vecprod(primes(n))); (f(m, p, j) = my(list=List()); forprime(q=p, sqrtnint(B\m, j), my(v=m*q); while(v <= B, if(j==1, if(v>=A && (nextprime(v) - v == n) && (v - precprime(v) == n), listput(list, v)), if(v*(q+1) <= B, list=concat(list, f(v, q+1, j-1)))); v *= q)); list); vecsort(Vec(f(1, if(n%2 == 0, 3, 2), n)));
a(n) = my(x=vecprod(primes(n)), y=2*x); while(1, my(v=generate(x, y, n)); if(#v >= 1, return(v[1])); x=y+1; y=2*x); \\ Daniel Suteu, Mar 25 2025
A306475
Smallest nonprime number <= 10^n (n>=1) with maximum distance from a prime.
Original entry on oeis.org
9, 93, 897, 9569, 31433, 492170, 4652430, 47326803, 436273150, 4302407536, 42652618575, 738832928197, 7177162612050, 90874329411895, 218209405436996, 1693182318746937, 80873624627235459, 804212830686678390
Offset: 1
For n=1: first prime numbers are 2, 3, 5, 7 and 11. Maximum difference between two consecutive primes is 4 between 7 and 11 thus a(1)=9.
For n=4: maximum difference between two primes less than 10^4 is 36, which occurs once: between 9551 and 9587. a(4)=(9551 + 9587)/2 = 9569.
Showing 1-4 of 4 results.
Comments