cp's OEIS Frontend

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.

Showing 1-3 of 3 results.

A243906 (Number of semiprimes <= n) - (number of primes <= n).

Original entry on oeis.org

0, -1, -2, -1, -2, -1, -2, -2, -1, 0, -1, -1, -2, -1, 0, 0, -1, -1, -2, -2, -1, 0, -1, -1, 0, 1, 1, 1, 0, 0, -1, -1, 0, 1, 2, 2, 1, 2, 3, 3, 2, 2, 1, 1, 1, 2, 1, 1, 2, 2, 3, 3, 2, 2, 3, 3, 4, 5, 4, 4, 3, 4, 4, 4, 5, 5, 4, 4, 5, 5, 4, 4, 3, 4, 4, 4, 5, 5, 4, 4, 4, 5, 4, 4, 5, 6, 7, 7, 6, 6, 7, 7, 8
Offset: 1

Views

Author

N. J. A. Sloane, Jun 14 2014

Keywords

Comments

We know from the asymptotic formulas (see Landau) that the sequence is almost always positive.

References

  • E. Landau, Handbuch der Lehre von der Verteilung der Primzahlen, vol. 1, Teubner, Leipzig, 1909; third edition : Chelsea, New York (1974).

Crossrefs

Programs

  • Maple
    g:= proc(n) if isprime(n) then -1 elif numtheory:-bigomega(n) = 2 then 1 else 0 fi end proc:
    ListTools:-PartialSums(map(g, [$1..100])); # Robert Israel, Dec 20 2022
  • Mathematica
    Accumulate[Table[Which[PrimeQ[n],-1,PrimeOmega[n]==2,1,True,0],{n,1000}]] (* Harvey P. Dale, Jun 15 2014 *)
  • PARI
    a(n) = #select(x->(bigomega(x) == 2), [1..n]) - primepi(n); \\ Michel Marcus, Dec 20 2022
    
  • Python
    from math import isqrt
    from sympy import prime, primepi
    def A243906(n): return int(sum(primepi(n//prime(k))-k+1 for k in range(1,primepi(isqrt(n))+1)))-primepi(n) # Chai Wah Wu, Jul 23 2024

Formula

a(n) = A072000(n) - A000720(n). - Michel Marcus, Dec 20 2022

A358677 Irregular triangle where row n gives the columns of A340316 whose minimum value is in row n of A340316. The lists of column indices are given in abbreviated form, using pairs (x, y) to mean the range [x..y].

Original entry on oeis.org

1, 16, 18, 18, 21, 21, 17, 17, 19, 20, 22, 265549, 265604, 265605, 265608, 265681, 265683, 265829, 265831, 265831, 265835, 265836, 265850, 265850, 265853, 265853, 265862, 265873, 265550, 265603, 265606, 265607, 265682, 265682, 265830, 265830, 265832, 265834, 265837, 265849, 265851, 265852, 265854, 265861
Offset: 1

Views

Author

Michel Marcus, Dec 12 2022

Keywords

Comments

This sequence is a spin-off from old comments of A340316 (see history there).
Pending availability of tighter constraints, we assume that there are no more values in row n here only after we reach a column of A340316 where the value in A340316 row n is greater than the value in A340316 row n+2.
Presumably, using the results from Landau as they apply to A276176, it can similarly be shown that every row here is finite. - Peter Munn, Dec 20 2022

Examples

			First 2 rows are:
 {1..16, 18..18, 21..21} for [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,18,21];
 {17..17, 19..20, 22..265549, 265604..265605, 265608..265681, 265683..265829, 265831..265831, 265835..265836, 265850..265850, 265853..265853, 265862..265873}.
The A340316 first 2 rows being:
   1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22
  -----------------------------------------------------------------
   2  3  5  7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79
   6 10 14 15 21 22 26 33 34 35 38 39 46 51 55 57 58 62 65 69 74 77
     the first columns that give row 2:           ^^    ^^ ^^    ^^
Row 3 begins: {265550..265603, 265606..265607, 265682..265682, 265830..265830, 265832..265834, ...
		

Crossrefs

Programs

  • PARI
    showlist(list) = {my(slist = List()); listput(slist, list[1]); for (i=2, #list, if (list[i] != list[i-1]+1, listput(slist, list[i-1]); listput(slist, list[i]););); listput(slist, list[#list]); Vec(slist);}
    primo(i) = factorback(primes(i));
    ubound(nL, n) = {if (nL == 1, return(n*log(n) + n*log(log(n)))); if (nL == 2, return(n*log(n)/log(log(n)))); if (nL == 3, return(2*n*log(n)/log(log(n))^2)); if (nL == 4, return(3*n*log(n)/log(log(n))^3)); if (nL == 5, return(4*n*log(n)/log(log(n))^4));}
    out(list1, list2, list3) = print(showlist(list1)); print(showlist(list2)); print(showlist(list3));
    rows() = {my(nL = 3, nC = 1000000, nB=5); my(m=vector(nL, i, vector(nC))); my(vfirst = vector(nL, i, primo(i))); my(list1 = List(), list2 = List(), list3 = List()); for (nn=1, nB, my(ok=1); print("nn=", nn); for (i=1, nL, my(list = List()); my(na = vfirst[i]); my(ns = 1); if (nn==1, m[i][ns] = na; ns++); forsquarefree (k=na+1, 100*round(ubound(i,nn*nC)), if (omega(k[2]) == i, m[i][ns] = k[1]; ns++); if (ns > nC, break)); if (ns < nC, print("not enough"); out(list1, list2, list3); return;);); N = 1; for (j=1, nC, if (m[N][j] == vecmin (vector(nL, r, m[r][j])), listput(list1, j+(nn-1)*nC));); N = 2; for (j=1, nC, if (m[N][j] == vecmin (vector(nL, r, m[r][j])), listput(list2, j+(nn-1)*nC));); N = 3; for (j=1, nC, if (m[N][j] == vecmin (vector(nL, r, m[r][j])), listput(list3, j+(nn-1)*nC));); vfirst = vector(nL, i, m[i][nC]); for (i=1, nL, m[i] = vector(nC));); out(list1, list2, list3);}

Extensions

Provisional rule for calculating that row n is full added by Peter Munn, Jan 03 2023

A359242 Consider the race between primes, squarefree semiprimes, ..., products of k distinct primes; sequence indicates when one overtakes another to give a new race leader.

Original entry on oeis.org

2, 58, 61, 65, 73, 77, 1279789, 1280057, 1280066, 1280073, 1280437, 1280441, 1281155, 1281161, 1281165, 1281179, 1281190, 1281243, 1281247, 1281262, 1281271, 1281313, 1281365
Offset: 1

Views

Author

Michel Marcus, Dec 22 2022

Keywords

Comments

This is A276176 for squarefree integers as listed in A340316 table.

Crossrefs

Essentially the same as A335293.

Programs

  • PARI
    lista() = {my(nb = 10^7); my(ip = 1); while (factorback(primes(ip)) < nb, ip++); my(vp = vector(ip), list = List([2]), listi = List([1]), lastnb=1, lasti=1, nba = 3, nbb = nb); vp[lasti]++; for (i=1, 2, forsquarefree(isqf=nba, nbb, my(newi = omega(isqf[2])); vp[newi]++; if (newi != lasti,  if (vp[newi] > vp[lasti], lasti = newi; listput(list, isqf[1]); listput(listi, vp[newi]);););); nba = nbb + 1; nbb = nbb + nb;); Vec(list);} \\ Michel Marcus, Dec 22 2022

Extensions

Name clarified by Peter Munn, Dec 31 2022
Showing 1-3 of 3 results.