A180126 a(n) is the least k such that for numbers x >= k, PrimePi(n,x) > PrimePi(n-1,x), where PrimePi(n,x) is the number of n-almost-primes <= x.
3, 34, 15530, 151165607042
Offset: 1
Extensions
Name edited by Peter Munn, Jan 04 2023
This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
a(0) = 1 because 1 is the first and only positive integer (A000027) which is not a prime, a semiprime, a triprime, etc.; a(1) = 17 because 17 is the seventh term of A000040 (it is also the first term of A046883); a(2) = 291 because 291 is the 91st term of A001358; a(3) = 12 because 12 is the second term of A014612; a(4) = 56 because 56 is the sixth term of A014613; etc.
nextKthAlmostPrime[n_, k_] := Block[{m = n + 1}, While[ Plus @@ Last /@ FactorInteger@ m != k, m++]; m] (* Eric W. Weisstein, Feb 07 2006 *); f[n_] := Block[{c = 1, kp = 2^n}, While[ Mod[kp, 10^Floor[1 + Log10@ c]] != c, c++; kp = nextKthAlmostPrime[kp, n]]; kp] (* These terms can be crosschecked by: *) AlmostPrimePi[k_Integer, n_] := Module[{a, i}, a[0] = 1; If[k == 1, PrimePi[n], Sum[PrimePi[n/Times @@ Prime[Array[a, k - 1]]] - a[k - 1] + 1, Evaluate[ Sequence @@ Table[{a[i], a[i - 1], PrimePi[(n/Times @@ Prime[Array[a, i - 1]])^(1/(k - i + 1))]}, {i, k - 1}]]]]] (* Eric W. Weisstein, Feb 07 2006 *)
a(1) = 10 since the first term relates to 1-almost-primes, which are the primes themselves; and there are 4 primes <= 10, and 2*4 = 8 primes <= 2*10 = 20; but for m = 11 and all larger integers, the number of primes <= 2*m is less than twice the number of primes <= m. - _Peter Munn_, Dec 23 2022
AlmostPrimePi[k_Integer, n_] := Module[{a, i}, a[0] = 1; If[k == 1, PrimePi[n], Sum[ PrimePi[n/Times @@ Prime[Array[a, k - 1]]] - a[k - 1] + 1, Evaluate[Sequence @@ Table[{a[i], a[i - 1], PrimePi[(n/Times @@ Prime[Array[a, i - 1]])^(1/(k - i + 1))]}, {i, k - 1}]] ]]]; (* Eric W. Weisstein, Feb 07 2006 *)
If written as a triangle: 0, 1, 1, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 1, 1, 2, 3, 2, 1, 1, 2, 1, 2, 1, 3, 2, 1, 1, 1, 1, 1, 2, 2, 1, 3, 1, 2, 1, 3, 1, 1, 2, 3, 1, 2, 2, 1, 2, 1, 3, 1, 2, 1, 2, 2, 3, 1, 4, 1, 1, 2, 1, 1, 1, 1, 3, 2, 1, 2, 2, 1, 3.
For n = 3, 50 = 2*5*5, and the numbers before and after 50 are 49 = 7*7 and 51 = 3*17.
a[n_] := Module[{o={0,0,0}, k=1}, While[o!={n-1,n,n-1}, o=Rest[AppendTo[o,PrimeOmega[k]]]; k++]; k-2]; Array[a,7,2] (* Amiram Eldar, Nov 14 2018 *)
{for(n=2,10,for(k=2^n,10^12,if(n==bigomega(k) && n-1==bigomega(k-1) && n-1==bigomega(k+1),print1(k", ");break())))}
Both 2*5+3*7 = 31 and 3*5 +2*7 = 29 are primes. Both 2*47+3*53 = 253 = 11*23 and 3*47+2*53 = 247 = 13*19 are semiprimes.
m = 6; s = Table[0, {m}]; p = 2; c = 0; While[c < m, q = NextPrime[p]; If[(o = PrimeOmega[2 p + 3 q]) == PrimeOmega[ 3 p + 2 q] && o <= m && s[[o]] == 0, c++; s[[o]] = p]; p = q]; s (* Amiram Eldar, Jun 23 2020 *)
for(n=1,8,my(p=2); forprime(q=3, oo, my(pq=2*p+3*q, qp=3*p+2*q); if(bigomega(pq)==n, if(bigomega(qp)==n, print1(p, ", "); break));p=q)) \\ Hugo Pfoertner, Jun 24 2020
a(1) = 3 since Sum_{k=1..2} 1/prime(k) = 1/2 + 1/3 = 5/6 < 1 and Sum_{k=1..3} 1/prime(k) = 1/2 + 1/3 + 1/5 = 31/30 > 1. a(2) = 13 since Sum_{k=1..12} 1/A001358(k) = 1/4 + 1/6 + 1/9 + 1/10 + 1/14 + 1/15 + 1/21 + 1/22 + 1/25 + 1/26 + 1/33 + 1/34 = 15271237/15315300 < 1 and Sum_{k=1..13} 1/A001358(k) = 1/4 + 1/6 + ... + 1/35 = 15708817/15315300 > 1.
next[p_, n_] := Module[{k = p + 1}, While[PrimeOmega[k] != n, k++]; k]; a[n_] := Module[{k = 0, sum = 0, p = 0}, While[sum <= 1, p = next[p, n]; sum += 1/p; k++]; k]; Array[a, 5]
nextnum(p, n) = {my(k = p + 1); while(bigomega(k) != n, k++); k;} a(n) = {my(k = 0, sum = 0, p = 0); while(sum <= 1, p = nextnum(p, n); sum += 1/p; k++); k;}
Comments