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-10 of 16 results. Next

A289171 Irregular triangle T(n, k) read by rows with 1 <= k <= n: T(n, 1) = A020900(n - k + 1) - (n - k + 1) and T(n, k) = max(0, T(n - 1, k - 1) - 1) otherwise.

Original entry on oeis.org

1, 1, 1, 2, 3, 1, 3, 2, 4, 2, 1, 4, 3, 1, 5, 3, 2, 6, 4, 2, 1, 7, 5, 3, 1, 9, 6, 4, 2, 9, 8, 5, 3, 1, 9, 8, 7, 4, 2, 9, 8, 7, 6, 3, 1, 11, 8, 7, 6, 5, 2, 13, 10, 7, 6, 5, 4, 1, 12, 12, 9, 6, 5, 4, 3, 13, 11, 11, 8, 5, 4, 3, 2, 14, 12, 10, 10, 7, 4, 3, 2, 1
Offset: 1

Views

Author

Michael De Vlieger, Jul 21 2017

Keywords

Examples

			Triangle begins:
n  a(n)
1:    0
2:    1
3:    1
4:    2
5:    3   1
6:    3   2
7:    4   2   1
8:    4   3   1
9:    5   3   2
10:   6   4   2   1
11:   7   5   3   1
12:   9   6   4   2
13:   9   8   5   3   1
14:   9   8   7   4   2
15:   9   8   7   6   3   1
16:  11   8   7   6   5   2
17:  13  10   7   6   5   4   1
18:  12  12   9   6   5   4   3
19:  13  11  11   8   5   4   3   2
20:  14  12  10  10   7   4   3   2   1
   ...
		

Crossrefs

Programs

  • Mathematica
    T[n_, k_] := T[n, k] = If[k == 1, PrimePi[2 Prime@ #] - # &[n - k + 1], Max[0, T[n - 1, k - 1] - 1]]; Map[DeleteCases[#, 0] &, Table[T[n, k], {n, 20}, {k, n}]] // Flatten (* or *)
    T[n_, k_] := T[n, k] = If[k == 1, PrimePi[2 Prime@ #] - # &[n - k + 1], Max[0, T[n - 1, k - 1] - 1]]; Table[T[n, k], {n, 60}, {k, Count[Range[# + 1, 2 # - 1] &@ Prime[n + 1], s_ /; PrimeOmega@ s == 2 && EvenQ@ s]}] // Flatten (* Michael De Vlieger, Jul 21 2017 *)

Formula

Row lengths = A107347(n + 1).

A166251 Isolated primes: Primes p such that there is no other prime in the interval [2*prevprime(p/2), 2*nextprime(p/2)].

Original entry on oeis.org

5, 7, 23, 37, 79, 83, 89, 163, 211, 223, 257, 277, 317, 331, 337, 359, 383, 389, 397, 449, 457, 467, 479, 541, 547, 557, 563, 631, 673, 701, 709, 761, 787, 797, 839, 863, 877, 887, 919, 929, 977, 1129, 1181, 1201, 1213, 1237, 1283, 1307, 1327, 1361, 1399, 1409
Offset: 1

Views

Author

Vladimir Shevelev, Oct 10 2009, Oct 14 2009

Keywords

Comments

Other formulation: Suppose a prime p >= 5 lies in the interval (2p_k, 2p_(k+1)), where p_n is the n-th prime; p is called isolated if the interval (2p_k, 2p_(k+1)) does not contain any other primes.
The sequence is connected with the following classification of primes: The first two primes 2,3 form a separate set of primes; let p >= 5 be in interval(2p_k, 2p_(k+1)), then 1)if in this interval there are primes only more than p, then p is called a right prime; 2) if in this interval there are primes only less than p, then p is called a left prime; 3) if in this interval there are prime more and less than p, then p is called a central prime; 4) if this interval does not contain other primes, then p is called an isolated prime. In particular, the right primes form sequence A166307 and all Ramanujan primes (A104272) more than 2 are either right or central primes; the left primes form sequence A182365 and all Labos primes (A080359) greater than 3 are either left or central primes.
From Peter Munn, Jun 01 2023: (Start)
The isolated primes are prime(k) such that k-1 and k occur as consecutive terms in A020900.
In the tree of primes described in A290183, the isolated primes label the nodes with no sibling nodes.
Conjecture: a(n)/A000040(n) is asymptotic to 9. This would follow from my conjectured asymptotic proportion of 1's in A102820 (the first differences of A020900).
(End)

Examples

			Since 2*17 < 37 < 2*19, and the interval (34, 38) does not contain other primes, 37 is an isolated prime.
		

Crossrefs

Programs

  • Haskell
    a166251 n = a166251_list !! (n-1)
    a166251_list = concat $ (filter ((== 1) . length)) $
       map (filter ((== 1) . a010051)) $
       zipWith enumFromTo a100484_list (tail a100484_list)
    -- Reinhard Zumkeller, Apr 27 2012
    
  • Mathematica
    isolatedQ[p_] := p == NextPrime[2*NextPrime[p/2, -1]] && p == NextPrime[2*NextPrime[p/2], -1]; Select[Prime /@ Range[300], isolatedQ] (* Jean-François Alcover, Nov 29 2012, after M. F. Hasler *)
  • PARI
    is_A166251(n)={n==nextprime(2*precprime(n\2)) & n==precprime(2*nextprime(n/2))}  \\ M. F. Hasler, Oct 05 2012

Extensions

Edited by N. J. A. Sloane, Oct 15 2009
More terms from Alois P. Heinz, Apr 26 2012
Given terms double-checked with new PARI code by M. F. Hasler, Oct 05 2012

A020901 Greatest k such that k-th prime < 3 times n-th prime.

Original entry on oeis.org

3, 4, 6, 8, 11, 12, 15, 16, 19, 23, 24, 29, 30, 31, 34, 37, 40, 42, 46, 47, 47, 51, 53, 56, 61, 62, 63, 66, 66, 68, 75, 77, 80, 80, 86, 87, 91, 93, 95, 97, 99, 100, 105, 106, 107, 108, 115, 121, 123, 124, 125, 127, 128, 133, 136, 138, 139, 141, 145
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    Table[PrimePi[NextPrime[3Prime[n],-1]],{n,60}] (* Harvey P. Dale, Feb 21 2014 *)
  • PARI
    a(n) = primepi(3*prime(n)) \\ Michel Marcus, Mar 22 2013

A102820 Number of primes between 2*prime(n) and 2*prime(n+1), where prime(n) is the n-th prime.

Original entry on oeis.org

1, 1, 2, 2, 1, 2, 1, 2, 2, 2, 3, 1, 1, 1, 3, 3, 0, 2, 2, 0, 3, 1, 2, 4, 2, 0, 1, 0, 1, 6, 1, 3, 1, 3, 0, 3, 1, 1, 1, 3, 1, 3, 1, 1, 1, 4, 4, 1, 1, 2, 1, 1, 3, 2, 2, 0, 1, 1, 1, 1, 3, 6, 2, 0, 1, 6, 1, 3, 0, 1, 1, 3, 2, 2, 1, 2, 1, 1, 2, 4, 1, 3, 1, 1, 2, 1, 2, 1, 0, 1, 4, 2, 1, 3, 0, 2, 5, 0, 5, 3, 3, 2, 1, 0, 2
Offset: 1

Views

Author

Ali A. Tanara (tanara(AT)khayam.ut.ac.ir), Feb 27 2005

Keywords

Comments

Number of primes between successive even semiprimes. [Juri-Stepan Gerasimov, May 01 2010]
From Peter Munn, Jun 01 2023: (Start)
First differences of A020900.
A080192 lists prime(n) corresponding to the zero terms.
A104380(k) is prime(n) corresponding to the first occurrence of k as a term.
If a(n) is nonzero, A059786(n) is the smallest and A059788(n+1) the largest of the a(n) enumerated primes. In the tree of primes described in A290183, these primes label the child nodes of prime(n).
Conjecture: the asymptotic proportions of 0's, 1's, ... , k's, ... are 1/3, 2/9, ... , 2^k/3^(k+1), ... .
(End)

Examples

			a(15)=3 because there are 3 primes between the doubles of the 15th and 16th primes, that is between 2*47 and 2*53.
		

Crossrefs

Sequences with related analysis: A020900, A059786, A059788, A080192, A104380, A290183.
Cf. A104272, A080359. [Vladimir Shevelev, Aug 24 2009]
Sequences with similar definitions: A104289, A217564.

Programs

  • Haskell
    a102820 n = a102820_list !! (n-1)
    a102820_list =  map (sum . (map a010051)) $
       zipWith enumFromTo a100484_list (tail a100484_list)
    -- Reinhard Zumkeller, Apr 29 2012
    
  • Mathematica
    Table[PrimePi[2 Prime[n+1]]-PrimePi[2 Prime[n]], {n, 150}] (* Zak Seidov *)
    Differences[PrimePi[2 Prime[Range[110]]]] (* Harvey P. Dale, Oct 29 2022 *)
  • PARI
    a(n) = primepi(2*prime(n+1)) - primepi(2*prime(n)); \\ Michel Marcus, Sep 22 2017

Formula

a(n) = A020900(n+1) - A020900(n). - Peter Munn, Jun 01 2023

Extensions

More terms from Zak Seidov, Feb 28 2005

A020934 Greatest k such that (k-th prime) < (4 times n-th prime).

Original entry on oeis.org

4, 5, 8, 9, 14, 15, 19, 21, 24, 30, 30, 34, 38, 39, 42, 47, 51, 53, 56, 61, 61, 65, 67, 71, 76, 79, 80, 82, 84, 87, 96, 99, 101, 101, 108, 110, 114, 118, 121, 125, 127, 128, 135, 136, 138, 138, 146, 154, 155, 156, 158, 162, 162, 168, 172, 177, 180, 180, 185, 188
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    Table[PrimePi[NextPrime[4Prime[n],-1]],{n,60}] (* Harvey P. Dale, Jan 15 2012 *)

Extensions

More terms from Henry Bottomley, Nov 13 2000

A057855 Greatest k such that (k-th prime) <= (n times n-th prime).

Original entry on oeis.org

1, 3, 6, 9, 16, 21, 30, 36, 46, 61, 68, 86, 99, 110, 126, 146, 168, 184, 205, 223, 242, 270, 292, 321, 360, 381, 404, 429, 446, 477, 546, 574, 614, 637, 693, 717, 762, 804, 842, 890, 935, 965, 1029, 1059, 1105, 1134, 1222, 1304, 1348, 1381, 1423, 1483
Offset: 1

Views

Author

Henry Bottomley, Nov 13 2000

Keywords

Comments

Might be roughly n^2/2 (seems to be marginally more at least for small n).

Examples

			a(4)=9 since 4th prime is 7, 4*7=28, greatest prime less than or equal to 28 is 23 which is the 9th prime.
		

Crossrefs

Cf. A020900, A020901, A020934-A020940, A033286 (n*prime(n)).

Programs

  • Maple
    a:= n-> numtheory[pi](n*ithprime(n)):
    seq(a(n), n=1..61);  # Alois P. Heinz, Aug 30 2019
  • Mathematica
    Table[PrimePi[w*Prime[w]], {w, 1, 100}]
  • PARI
    a(n) = primepi(n*prime(n)); \\ Michel Marcus, Aug 30 2019

Formula

a(n) = pi(n*prime(n)).

A288813 Irregular triangle read by rows: T(m, k) is the list of squarefree numbers A002110(m) < t < 2*A002110(m) such that A001221(t) = m.

Original entry on oeis.org

3, 10, 42, 330, 390, 2730, 3570, 3990, 4290, 39270, 43890, 46410, 51870, 53130, 570570, 690690, 746130, 870870, 881790, 903210, 930930, 1009470, 11741730, 13123110, 14804790, 15825810, 16546530, 17160990, 17687670, 18888870, 281291010, 300690390, 340510170
Offset: 1

Views

Author

Michael De Vlieger, Jun 24 2017

Keywords

Comments

a(n) = terms t of row m of A288784 such that A002110(m) < t < 2*A002110(m).
The only odd term is 3; the only other term not ending in 10, 30, 70, or 90 in decimal is 42.
All terms t in row m have A001221(t) = m and at least one prime q coprime to t such that q < A006530(t).
Consider "tier" m and primorial p_m# = A002110(m), let "distension" i = pi(A006530(T(m, k))) - m and let "depth" j = m - pi(A053669(T(m, k))) + 1. Distension is the difference in the index of gpf(T(m, k)) and pi(m), while depth is the difference between the index of the least prime totative of T(m, k) and pi(m) + 1. We can calculate the maximum distension i given m and j via i_max = A020900(m - j + 1) - m - j + 1. This enables us to use permutations of 0 and 1 values in the notation A054841 and produce a(n) with some efficiency.
The most efficient method of generating a(n) is via f(x) = A287352(x), i.e., subtracting 1 from all values in row x of A287352. We use a pointer variable to direct increment on f(p_m#) = a constant array of m 1's, until we have exhausted producing terms p_m# < t < 2*p_m#. This enables the generation of T(m, k) for 1 <= m <= 100.

Examples

			Triangle begins:
n     a(n)
1:       3
2:      10
3:      42
4:     330     390
5:    2730    3570    3990    4290
6:   39270   43890   46410   51870   53130
7:  570570  690690  746130  870870  881790  903210  930930  1009470
       ...
		

Crossrefs

Programs

  • Mathematica
    Table[Function[P, Select[Range[P + 1, 2 P - 1], And[SquareFreeQ@ #, PrimeOmega@ # == n] &]]@ Product[Prime@ i, {i, n}], {n, 7}] // Flatten (* Michael De Vlieger, Jun 24 2017 *)
    f[n_] := Block[{P = Product[Prime@ i, {i, n}], lim, k = 1, c, w = ConstantArray[1, n]}, lim = 2 P; Sort@ Reap[Do[w = If[k == 1, MapAt[# + 1 &, w, -k], Join[Drop[MapAt[# + 1 &, w, -k], -k + 1], ConstantArray[1, k - 1]]]; c = Times @@ Map[If[# == 0, 1, Prime@ #] &, Accumulate@ w]; If[c < lim, Sow[c]; k = 1, If[k == n, Break[], k++]], {i, Infinity}] ][[-1, 1]] ]; Array[f, 9] // Flatten (* Michael De Vlieger, Jun 28 2017, faster *)
  • PARI
    primo(n) = prod(i=1, n, prime(i));
    row(n) = my(vrow = []); for (j=primo(n)+1, 2*primo(n)-1, if (issquarefree(j) && (omega(j)==n), vrow = concat(vrow, j))); vrow;
    tabf(nn) = for (n=1, nn, print(row(n))); \\ Michel Marcus, Jun 29 2017

A331677 a(n) is the difference between the number of primes smaller than prime(n) (i.e., n-1) and greater than prime(n) but less than 2*prime(n).

Original entry on oeis.org

-1, 0, 1, 1, 1, 2, 2, 3, 3, 3, 3, 2, 3, 4, 5, 4, 3, 5, 5, 5, 7, 6, 7, 7, 5, 5, 7, 8, 10, 11, 7, 8, 7, 8, 7, 9, 8, 9, 10, 11, 10, 11, 10, 11, 12, 13, 11, 9, 10, 11, 11, 12, 13, 12, 12, 12, 14, 15, 16, 17, 18, 17, 13, 13, 15, 16, 12, 13, 12, 14, 15, 16, 15, 15
Offset: 1

Views

Author

Todor Szimeonov, Jan 24 2020

Keywords

Crossrefs

Programs

  • PARI
    a(n) = 2*n - 1 - primepi(2*prime(n)); \\ Michel Marcus, Feb 02 2020

Formula

a(n) = (2*n-1) - A020900(n). - Michel Marcus, Feb 02 2020
a(n) = n - 1 - A070046(n). - M. F. Hasler, Feb 29 2020
a(n) = A334051(n) - 1. - Alois P. Heinz, Oct 09 2020

A334051 The difference between the number of prime numbers in the ranges (1, p_n] and (p_n, 2*p_n], where p_n is the n-th prime.

Original entry on oeis.org

0, 1, 2, 2, 2, 3, 3, 4, 4, 4, 4, 3, 4, 5, 6, 5, 4, 6, 6, 6, 8, 7, 8, 8, 6, 6, 8, 9, 11, 12, 8, 9, 8, 9, 8, 10, 9, 10, 11, 12, 11, 12, 11, 12, 13, 14, 12, 10, 11, 12, 12, 13, 14, 13, 13, 13, 15, 16, 17, 18, 19, 18, 14, 14, 16, 17, 13, 14, 13, 15, 16, 17, 16, 16
Offset: 1

Views

Author

Ya-Ping Lu, Sep 11 2020

Keywords

Examples

			a(6) = 2*6 - pi(2*p_6) = 12 - pi(2*13) = 12 - pi(26) = 12 - 9 = 3.
		

Crossrefs

Programs

  • PARI
    a(n) = 2*n - primepi(2*prime(n)); \\ Michel Marcus, Sep 11 2020
  • Python
    from sympy import prime, primepi
    for n in range(1, 10001):
        a = 2*n - primepi(2*prime(n))
        print(a)
    

Formula

a(n) = 2*n - pi(2*p_n).
a(n) = 2*n - A020900(n). - Michel Marcus, Sep 11 2020
a(n) = 1 + A331677(n). - Alois P. Heinz, Oct 09 2020

A376762 Number of composite numbers c in the range prime(n) < c <= 2*prime(n+1).

Original entry on oeis.org

2, 5, 6, 11, 11, 16, 16, 21, 28, 25, 33, 35, 35, 41, 47, 51, 50, 59, 60, 61, 69, 71, 78, 85, 84, 85, 91, 92, 98, 117, 111, 117, 115, 131, 126, 134, 140, 142, 150, 154, 152, 168, 162, 168, 168, 187, 196, 192, 192, 197, 205, 203, 219, 220, 225, 232, 230, 240, 242, 242, 258, 271, 264, 265, 271, 290, 288, 300, 295, 301, 309, 317, 320, 325, 327, 334, 344, 344, 355, 364, 358
Offset: 1

Views

Author

N. J. A. Sloane, Oct 29 2024

Keywords

Examples

			a(2) = 5 because there are 5 composite numbers c in the range 3 < c <= 10, namely 4, 6, 8, 9, and 10.
		

Crossrefs

Programs

  • Mathematica
    A376762[n_] := n - Prime[n] + 2*Prime[n+1] - PrimePi[2*Prime[n+1]];
    Array[A376762, 100] (* Paolo Xausa, Oct 29 2024 *)
  • Python
    from sympy import prime, nextprime, primepi
    def A376762(n): return int(n-(p:=prime(n))+(q:=nextprime(p)<<1)-primepi(q)) # Chai Wah Wu, Oct 29 2024

Formula

a(n) = 2*q - pi(2*q) - p + n, where p = prime(n), q = prime(n+1), and pi() = A000720().
a(n) = A210497(n) - A020900(n+1) + n. - Paolo Xausa, Oct 29 2024
Showing 1-10 of 16 results. Next