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 12 results. Next

A162775 a(n) = A141042(n+1)/2.

Original entry on oeis.org

2, 3, 8, 5, 12, 7, 16, 27, 10, 33, 24, 13, 28, 45, 48, 17, 54, 38, 20, 63, 44, 69, 96, 50, 26, 54, 28, 58, 210, 62, 96, 33, 170, 35, 108, 111, 76, 117, 120, 41, 210, 43, 88, 45, 276, 282, 96, 49, 100, 153, 52, 265, 162, 165, 168, 57, 174, 118, 60
Offset: 1

Views

Author

Omar E. Pol, Jul 30 2009

Keywords

Crossrefs

Extensions

More terms from Sean A. Irvine, Jun 22 2011

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

Original entry on oeis.org

2, 6, 15, 28, 55, 78, 119, 152, 207, 290, 341, 444, 533, 602, 705, 848, 1003, 1098, 1273, 1420, 1533, 1738, 1909, 2136, 2425, 2626, 2781, 2996, 3161, 3390, 3937, 4192, 4521, 4726, 5215, 5436, 5809, 6194, 6513, 6920, 7339, 7602, 8213, 8492, 8865, 9154, 9917
Offset: 1

Views

Author

Keywords

Comments

Does an n exist such that n*prime(n)/(n+prime(n)) is an integer? - Ctibor O. Zizka, Mar 04 2008. The answer to Zizka's question is easily seen to be No: such an integer k would be positive and less than prime(n), but then k*(n + prime(n)) = prime(n)*n would be impossible. - Robert Israel, Apr 20 2015
Sums of rows of the triangle in A005145. - Reinhard Zumkeller, Aug 05 2009
Complement of A171520(n). - Jaroslav Krizek, Dec 13 2009
Partial sums of A090942. - Omar E. Pol, Apr 20 2015

Crossrefs

Cf. A005145 (primes repeated), A171520 (complement), A076146 (iterated).

Programs

Formula

a(n) = n * A000040(n) = n * A008578(n+1) = n * A158611(n+2). - Jaroslav Krizek, Aug 31 2009
a(n) = A007504(n) + A152535(n). - Omar E. Pol, Aug 09 2012
Sum_{n>=1} 1/a(n) = A124012. - Amiram Eldar, Oct 15 2020

Extensions

Correction for change of offset in A158611 and A008578 in Aug 2009 from Jaroslav Krizek, Jan 27 2010

A152535 a(n) = n*prime(n) - Sum_{i=1..n} prime(i).

Original entry on oeis.org

0, 1, 5, 11, 27, 37, 61, 75, 107, 161, 181, 247, 295, 321, 377, 467, 563, 597, 705, 781, 821, 947, 1035, 1173, 1365, 1465, 1517, 1625, 1681, 1797, 2217, 2341, 2533, 2599, 2939, 3009, 3225, 3447, 3599, 3833, 4073, 4155, 4575, 4661
Offset: 1

Views

Author

Omar E. Pol, Dec 06 2008

Keywords

Comments

a(n) is also the area under the curve of the function pi(x) from 0 to prime(n). - Omar E. Pol, Nov 13 2013

Examples

			From _Omar E. Pol_, Apr 27 2015: (Start)
For n = 5 the 5th prime is 11 and the sum of first five primes is 2 + 3 + 5 + 7 + 11 = 28, so a(5) = 5*11 - 28 = 27.
Illustration of a(5) = 27:
Consider a diagram in the first quadrant of the square grid in which the number of cells in the n-th horizontal bar is equal to the n-th prime, as shown below:
.      _ _ _ _ _ _ _ _ _ _ _
. 11  |_ _ _ _ _ _ _ _ _ _ _|
.  7  |_ _ _ _ _ _ _|* * * *
.  5  |_ _ _ _ _|* * * * * *
.  3  |_ _ _|* * * * * * * *
.  2  |_ _|* * * * * * * * *
.
a(5) is also the area (or the number of cells, or the number of *'s) under the bar's structure of prime numbers: a(5) = 1 + 4 + 6 + 16 = 27.
(End)
		

Crossrefs

Programs

  • Mathematica
    nn = 100; p = Prime[Range[nn]]; Range[nn] p - Accumulate[p] (* T. D. Noe, May 02 2011 *)
  • PARI
    vector(80, n, n*prime(n) - sum(k=1, n, prime(k))) \\ Michel Marcus, Apr 20 2015
    
  • Python
    from sympy import prime, primerange
    def A152535(n): return (n-1)*(p:=prime(n))-sum(primerange(p)) # Chai Wah Wu, Jan 01 2024
  • Sage
    [n*nth_prime(n) - sum(nth_prime(j) for j in range(1,n+1)) for n in range(1,45)] # Danny Rorabaugh, Apr 18 2015
    

Formula

a(n) = A033286(n) - A007504(n). - Omar E. Pol, Aug 09 2012
a(n) = A046992(A006093(n)). - Omar E. Pol, Apr 21 2015
a(n+1) = Sum_{k=A000124(n-1)..A000217(n)} A204890(k). - Benedict W. J. Irwin, May 23 2016
a(n) = Sum_{k=1..n-1} k*A001223(k). - François Huppé, Mar 16 2022

A230850 A054541 and A000012 interleaved.

Original entry on oeis.org

2, 1, 1, 1, 2, 1, 2, 1, 4, 1, 2, 1, 4, 1, 2, 1, 4, 1, 6, 1, 2, 1, 6, 1, 4, 1, 2, 1, 4, 1, 6, 1, 6, 1, 2, 1, 6, 1, 4, 1, 2, 1, 6, 1, 4, 1, 6, 1, 8, 1, 4, 1, 2, 1, 4, 1, 2, 1, 4, 1, 14, 1, 4, 1, 6, 1, 2, 1, 10, 1, 2, 1, 6, 1, 6, 1, 4, 1, 6, 1, 6, 1, 2, 1, 10, 1, 2, 1
Offset: 1

Views

Author

Omar E. Pol, Oct 31 2013

Keywords

Comments

a(n) is also the length of the n-th edge of a staircase which represents the function pi(x) on the first quadrant of the square grid, see A000720.
a(2n-1) is the length of the n-th horizontal edge in the staircase.
a(2n) is the length of the n-th vertical edge in the staircase.
For another version see A230849.

Examples

			Illustration of initial terms, n = 1..22:
.
1                                                              _ _|
1                                                  _ _ _ _ _ _|
1                                          _ _ _ _|
1                                      _ _|
1                              _ _ _ _|
1                          _ _|
1                  _ _ _ _|
1              _ _|
1          _ _|
1        _|
1    _ _|
.
.      2 1   2   2       4   2       4   2       4           6   2
.
Drawing vertical line segments below the staircase (as shown below) we have that the number of cells in the vertical bars gives 0 together A000720.
Drawing horizontal line segments above the staircase we have that the number of cells in the k-th horizontal bar is A000040(k).
.    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
31  |_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|
29  |_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _| | |
23  |_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _| | | | | | | | |
19  |_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _| | | | | | | | | | | | |
17  |_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _| | | | | | | | | | | | | | |
13  |_ _ _ _ _ _ _ _ _ _ _ _ _| | | | | | | | | | | | | | | | | | |
11  |_ _ _ _ _ _ _ _ _ _ _| | | | | | | | | | | | | | | | | | | | |
7   |_ _ _ _ _ _ _| | | | | | | | | | | | | | | | | | | | | | | | |
5   |_ _ _ _ _| | | | | | | | | | | | | | | | | | | | | | | | | | |
3   |_ _ _| | | | | | | | | | | | | | | | | | | | | | | | | | | | |
2   |_ _|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|
.
.    0 0 1 2 2 3 3 4 4 4 4 5 5 6 6 6 6 7 7 8 8 8 8 9 9 9 9 9 9 10 10
.
		

Crossrefs

Programs

  • Mathematica
    Riffle[Join[{2},Differences[Prime[Range[100]]]],1] (* Paolo Xausa, Oct 31 2023 *)
  • PARI
    A230850(n) = if(1==n,2,if((n%2),prime((n+1)/2)-prime(((n+1)/2)-1),1)); \\ Antti Karttunen, Dec 23 2018

Formula

a(1) = 2; for n > 1, a(n) = A230849(n). - Antti Karttunen, Dec 23 2018

A090942 n-th arithmetic mean = prime(n).

Original entry on oeis.org

2, 4, 9, 13, 27, 23, 41, 33, 55, 83, 51, 103, 89, 69, 103, 143, 155, 95, 175, 147, 113, 205, 171, 227, 289, 201, 155, 215, 165, 229, 547, 255, 329, 205, 489, 221, 373, 385, 319, 407, 419, 263, 611, 279, 373, 289, 763, 787, 419, 327, 433, 545, 345, 781, 581, 593
Offset: 1

Views

Author

Amarnath Murthy, Dec 29 2003

Keywords

Comments

Partial sums give A033286. - Omar E. Pol, Apr 20 2015
In other words, this is the unique sequence such that for all n >= 1, (1/n) * Sum_{k=1..n} a(k) = prime(n). - Antti Karttunen, Apr 30 2015

Examples

			From _Omar E. Pol_, Apr 20 2015: (Start)
Illustration of initial terms:
Consider a diagram in the first quadrant of the square grid in which the length of the n-th horizontal line segment is equal to the n-th prime, as shown below:
.   _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.  |_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  51|
.  |_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _          83|   |
.  |_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _      55|           |   |
.  |_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _  33|       |           |   |
.  |_ _ _ _ _ _ _ _ _ _ _ _ _      41|   |       |           |   |
.  |_ _ _ _ _ _ _ _ _ _ _  23|       |   |       |           |   |
.  |_ _ _ _ _ _ _      27|   |       |   |       |           |   |
.  |_ _ _ _ _  13|       |   |       |   |       |           |   |
.  |_ _ _   9|   |       |   |       |   |       |           |   |
.  |_ _ 4|   |   |       |   |       |   |       |           |   |
.  |_2_|_|_ _|_ _|_ _ _ _|_ _|_ _ _ _|_ _|_ _ _ _|_ _ _ _ _ _|_ _|
.
a(n) is also the area (or the number of cells) in the n-th region of the diagram. For example: a(4) = 7 + 6 = 13.
(End)
		

Crossrefs

Programs

  • Magma
    [n le 1 select 2 else n*NthPrime(n) - (n-1)*NthPrime(n-1): n in [1..60]]; // G. C. Greubel, Feb 04 2019
    
  • Mathematica
    Table[If[n==1, 2, nPrime@n -(n-1)Prime[n-1]], {n, 60}] (* Michael De Vlieger, Apr 20 2015 *)
  • PARI
    vector(60, n, if(n==1,2, n*prime(n) -(n-1)*prime(n-1))) \\ G. C. Greubel, Feb 04 2019
    
  • Sage
    [2] + [n*nth_prime(n) - (n-1)*nth_prime(n-1) for n in (2..60)] # G. C. Greubel, Feb 04 2019

Formula

a(n) = n*prime(n) - (n-1)*prime(n-1).
a(n) = A033287(n-2), n>1. - R. J. Mathar, Sep 08 2008
a(n) = A000040(n) + A141042(n-1), n >=2. - Omar E. Pol, Apr 20 2015

Extensions

Corrected and extended by Ray Chandler, Dec 31 2003

A230849 A075526 and A000012 interleaved.

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 2, 1, 4, 1, 2, 1, 4, 1, 2, 1, 4, 1, 6, 1, 2, 1, 6, 1, 4, 1, 2, 1, 4, 1, 6, 1, 6, 1, 2, 1, 6, 1, 4, 1, 2, 1, 6, 1, 4, 1, 6, 1, 8, 1, 4, 1, 2, 1, 4, 1, 2, 1, 4, 1, 14, 1, 4, 1, 6, 1, 2, 1, 10, 1, 2, 1, 6, 1, 6, 1, 4, 1, 6, 1, 6, 1, 2, 1, 10, 1, 2, 1
Offset: 1

Views

Author

Omar E. Pol, Nov 01 2013

Keywords

Comments

a(n) is also the length of the n-th edge of a staircase which represents the function pi(x) on the first quadrant of the square grid, see A000720.
a(2n-1) is the length of the n-th horizontal edge in the staircase.
a(2n) is the length of the n-th vertical edge in the staircase.
For another version see A230850.

Examples

			Illustration of initial terms, n = 1..22:
.
1                                                            _ _|
1                                                _ _ _ _ _ _|
1                                        _ _ _ _|
1                                    _ _|
1                            _ _ _ _|
1                        _ _|
1                _ _ _ _|
1            _ _|
1        _ _|
1      _|
1    _|
.
.    1 1   2   2       4   2       4   2       4           6   2
.
Drawing vertical line segments below the staircase (as shown below) we have that the number of cells in the vertical bars gives A000720.
Drawing horizontal line segments above the staircase we have that the number of cells in the k-th horizontal bar is A006093(k).
.    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
30  |_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|
28  |_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _| | |
22  |_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _| | | | | | | | |
18  |_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _| | | | | | | | | | | | |
16  |_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _| | | | | | | | | | | | | | |
12  |_ _ _ _ _ _ _ _ _ _ _ _| | | | | | | | | | | | | | | | | | |
10  |_ _ _ _ _ _ _ _ _ _| | | | | | | | | | | | | | | | | | | | |
6   |_ _ _ _ _ _| | | | | | | | | | | | | | | | | | | | | | | | |
4   |_ _ _ _| | | | | | | | | | | | | | | | | | | | | | | | | | |
2   |_ _| | | | | | | | | | | | | | | | | | | | | | | | | | | | |
1   |_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|
.
.    0 1 2 2 3 3 4 4 4 4 5 5 6 6 6 6 7 7 8 8 8 8 9 9 9 9 9 9 10 10
.
		

Crossrefs

Programs

  • Mathematica
    Riffle[Join[{1},Differences[Prime[Range[100]]]],1] (* Paolo Xausa, Oct 31 2023 *)
  • PARI
    A230849(n) = if((n%2)&&(n>1),prime((n+1)/2)-prime(((n+1)/2)-1),1); \\ Antti Karttunen, Dec 23 2018

A230980 Number of primes <= n, starting at n=0.

Original entry on oeis.org

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

Views

Author

Omar E. Pol, Nov 02 2013

Keywords

Comments

Essentially identical to A000720, except that sequence, being an arithmetical sequence, starts at n = 1. - N. J. A. Sloane, Jun 21 2017
Also, on the first quadrant of the square grid, consider a diagram in which the number of cells in the horizontal bar of the k-th row is equal to the k-th prime, see example. The total length of the boundary segments between the structure formed by the first k horizontal bars and the structure formed by the vertical bars, from [0, 0], is equal to A014688(k). a(n) is the number of cells in the vertical bar of the n-th column.
Note that in a similar diagram for A000720 the lengths of the horizontal bars give A006093 (primes minus 1) not A000040 (the prime numbers) because A000720 has only one zero, not two.
Also, the number of distinct prime factors of the factorial number n!. - Torlach Rush, Jan 17 2014
The lengths of the boundary horizontal segments between the structure formed by the horizontal bars and the structure formed by the vertical bars of the diagram gives A054541. The zig-zag path formed by the boundary segments is in A230850. - Omar E. Pol, Jun 22 2017

Examples

			Illustration of initial terms:
.     _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
31   |_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|
29   |_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _| | |
23   |_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _| | | | | | | | |
19   |_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _| | | | | | | | | | | | |
17   |_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _| | | | | | | | | | | | | | |
13   |_ _ _ _ _ _ _ _ _ _ _ _ _| | | | | | | | | | | | | | | | | | |
11   |_ _ _ _ _ _ _ _ _ _ _| | | | | | | | | | | | | | | | | | | | |
7    |_ _ _ _ _ _ _| | | | | | | | | | | | | | | | | | | | | | | | |
5    |_ _ _ _ _| | | | | | | | | | | | | | | | | | | | | | | | | | |
3    |_ _ _| | | | | | | | | | | | | | | | | | | | | | | | | | | | |
2    |_ _|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|
.
n:    0 1 2 3 4 5 6 7 8 9...
a(n): 0 0 1 2 2 3 3 4 4 4 4 5 5 6 6 6 6 7 7 8 8 8 8 9 9 9 9 9 9 10 10
		

Crossrefs

Programs

Extensions

Offset and definition changed by N. J. A. Sloane, Jun 21 2017

A147965 a(n) = n + 1 - A001223(n) = n - A046933(n). In words, a(n) is the difference between n+1 and the n-th gap between primes.

Original entry on oeis.org

1, 1, 2, 1, 4, 3, 6, 5, 4, 9, 6, 9, 12, 11, 10, 11, 16, 13, 16, 19, 16, 19, 18, 17, 22, 25, 24, 27, 26, 17, 28, 27, 32, 25, 34, 31, 32, 35, 34, 35, 40, 33, 42, 41, 44, 35, 36, 45, 48, 47, 46, 51, 44, 49, 50, 51, 56, 53, 56, 59
Offset: 1

Views

Author

Omar E. Pol, Nov 17 2008

Keywords

Crossrefs

Programs

  • Mathematica
    Module[{nn=70,prg},prg=Differences[Prime[Range[nn]]];#[[2]]-#[[1]]&/@ Thread[{prg,Range[nn-1]}]+1] (* Harvey P. Dale, Nov 21 2021 *)

Extensions

Definition corrected by N. J. A. Sloane, Nov 21 2021, at the suggestion of Harvey P. Dale.

A147966 a(n) = n+(A001223(n)-1) = n+A046933(n).

Original entry on oeis.org

1, 3, 4, 7, 6, 9, 8, 11, 14, 11, 16, 15, 14, 17, 20, 21, 18, 23, 22, 21, 26, 25, 28, 31, 28, 27, 30, 29, 32, 43, 34, 37, 34, 43, 36, 41, 42, 41, 44, 45, 42, 51, 44, 47, 46, 57, 58, 51, 50, 53, 56, 53, 62, 59, 60, 61, 58, 63, 62, 61, 70, 75, 66, 65, 68, 79, 72, 77
Offset: 1

Views

Author

Omar E. Pol, Nov 17 2008

Keywords

Examples

			a(32) = A001223(32)-1+n = 6-1+32 = A046933(32)+n = 5+n = 37.
		

Crossrefs

Extensions

Definition clarified by N. J. A. Sloane, Nov 22 2021 at the suggestion of Harvey P. Dale.
a(32)=37 corrected by Georg Fischer, Oct 10 2024

A147967 a(n) = n*(A001223(n)-1) = n*A046933(n).

Original entry on oeis.org

0, 2, 3, 12, 5, 18, 7, 24, 45, 10, 55, 36, 13, 42, 75, 80, 17, 90, 57, 20, 105, 66, 115, 168, 75, 26, 81, 28, 87, 390, 93, 160, 33, 306, 35, 180, 185, 114, 195, 200, 41, 378, 43, 132, 45, 506, 517, 144, 49, 150, 255, 52, 477
Offset: 1

Views

Author

Omar E. Pol, Nov 17 2008

Keywords

Crossrefs

Cf. A001223 ("gap" with its usual meaning), A046933, A141042, A147965, A147966.

Programs

  • Mathematica
    Module[{nn=60,gps},gps=Differences[Prime[Range[nn+1]]]-1;Times@@@ Thread[ {Range[nn],gps}]] (* Harvey P. Dale, Nov 07 2020 *)

Extensions

Definition clarified by N. J. A. Sloane, Nov 22 2021 at the suggestion of Harvey P. Dale.
Showing 1-10 of 12 results. Next