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.

Previous Showing 11-20 of 29 results. Next

A368611 a(n) = Sum_{k=1..n} pi(k) * floor(n/k).

Original entry on oeis.org

0, 1, 3, 6, 9, 15, 19, 26, 32, 40, 45, 58, 64, 75, 86, 99, 106, 123, 131, 149, 163, 177, 186, 212, 224, 240, 255, 277, 287, 316, 327, 351, 369, 388, 406, 441, 453, 474, 494, 528, 541, 578, 592, 622, 651, 675, 690, 737, 756, 788, 812, 845, 861, 903, 927, 969, 995, 1022
Offset: 1

Views

Author

Wesley Ivan Hurt, Dec 31 2023

Keywords

Crossrefs

Programs

  • Mathematica
    Table[Sum[PrimePi[k] Floor[n/k], {k, n}], {n, 100}]

Formula

a(n) = A013939(n) + A368613(n).

A002815 a(n) = n + Sum_{k=1..n} pi(k), where pi() = A000720.

Original entry on oeis.org

0, 1, 3, 6, 9, 13, 17, 22, 27, 32, 37, 43, 49, 56, 63, 70, 77, 85, 93, 102, 111, 120, 129, 139, 149, 159, 169, 179, 189, 200, 211, 223, 235, 247, 259, 271, 283, 296, 309, 322, 335, 349, 363, 378, 393, 408, 423, 439, 455, 471
Offset: 0

Views

Author

Keywords

References

  • H. Brocard, Reply to Query 1421, Nombres premiers dans une suite de différences, L'Intermédiaire des Mathématiciens, 7 (1900), 135-137.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Haskell
    a002815 0 = 0
    a002815 n = a046992 n + toInteger n  -- Reinhard Zumkeller, Feb 25 2012
    
  • Mathematica
    Table[n + Sum[PrimePi[k], {k, 1, n}], {n, 0, 50}]
    Module[{nn=50,pp},pp=Accumulate[PrimePi[Range[0,nn]]];Total/@ Thread[ {Range[ 0,nn],pp}]] (* This program is significantly faster than the program above. *) (* Harvey P. Dale, Jan 03 2013 *)
  • PARI
    a(n) = my(p=primes([0,n])); n + (n+1)*#p - vecsum(p); \\ Ruud H.G. van Tol, Feb 16 2024
  • Python
    from sympy import primerange
    def A002815(n): return n+(n+1)*len(p:=list(primerange(n+1)))-sum(p) # Chai Wah Wu, Jan 01 2024
    

Formula

a(n) = A046992(n) + n for n > 0. - Reinhard Zumkeller, Feb 25 2012
Conjectured g.f.: (Sum_{N>=1} x^A008578(N))/(1-x)^2 = (x + x^2 + x^3 + x^5 + x^7 + x^11 + x^13 + ...)/(1-x)^2. - L. Edson Jeffery, Nov 25 2013

A034957 Divide natural numbers in groups with prime(n) elements and add together.

Original entry on oeis.org

1, 9, 35, 91, 242, 442, 833, 1273, 2024, 3306, 4464, 6586, 8897, 11137, 14288, 18762, 24190, 28670, 35778, 42813, 49275, 59329, 69056, 81702, 98067, 112110, 124836, 140919, 155325, 173568, 210312, 233835, 262903, 285923, 327949, 355001, 393285
Offset: 1

Views

Author

Patrick De Geest, Oct 15 1998

Keywords

Comments

Natural numbers starting from 0,1,2,3,...

Examples

			{0,1} #2 S=1;
{2,3,4} #3 S=9;
{5,6,7,8,9} #5 S=35;
{10,11,12,13,14,15,16} #7 S=91.
		

Crossrefs

Programs

  • Mathematica
    {1}~Join~Map[Abs@ Apply[Subtract, Map[PolygonalNumber, #]] &, Partition[Accumulate@ Prime@ Range@ 37 - 1, 2, 1]] (* Michael De Vlieger, Oct 06 2019 *)
    Module[{nn=40,tprs},tprs=Total[Prime[Range[nn]]];Total/@TakeList[Range[0,tprs],Prime[Range[nn]]]] (* Harvey P. Dale, Apr 18 2025 *)
  • Python
    from itertools import islice
    from sympy import nextprime
    def A034957_gen(): # generator of terms
        a, p = 0, 2
        while True:
            yield p*((a<<1)+p-1)>>1
            a, p = a+p, nextprime(p)
    A034957_list = list(islice(A034957_gen(),20)) # Chai Wah Wu, Mar 22 2023

Formula

From Hieronymus Fischer, Sep 27 2012: (Start)
a(n) = Sum_{k=A007504(n-1)+1..A007504(n)} (k-1), n > 1.
a(n) = (A007504(n) - A007504(n-1))*(A007504(n) + A007504(n-1) - 1)/2, n > 1.
a(n) = (A000217(A007504(n) - 1) - A000217(A007504(n-1) - 1)), n > 1.
If we define A007504(0):=0, then the formulas above are also true for n=1.
a(n) = A034959(n)/2.
a(n) = A034956(n) - A000040(n).
(End)

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

A249727 Start with a(1) = 1; then numbers 1 .. primepi(2), followed by numbers 1 .. primepi(3), and then numbers 1 .. primepi(4), ..., etc, where A000720 gives primepi.

Original entry on oeis.org

1, 1, 1, 2, 1, 2, 1, 2, 3, 1, 2, 3, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, 5, 1, 2, 3, 4, 5, 1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8, 9
Offset: 1

Views

Author

Antti Karttunen, Nov 06 2014

Keywords

Comments

Can be used to construct the irregular table A249809.
This is a fractal sequence; i.e., the removal of the first occurrence of each term in A249727 leaves A249727, so that the sequence contains itself infinitely many times. The corresponding interspersion is A272616. - Clark Kimberling, May 12 2016

Crossrefs

Programs

A368612 a(n) = Sum_{k=2..n} pi(k-1) * ceiling(n/k).

Original entry on oeis.org

0, 0, 1, 4, 8, 13, 20, 27, 37, 46, 56, 65, 81, 92, 107, 122, 140, 153, 175, 190, 214, 234, 254, 271, 304, 324, 347, 370, 399, 418, 454, 475, 509, 536, 564, 591, 635, 658, 689, 719, 763, 788, 835, 862, 904, 945, 981, 1010, 1070, 1103, 1148, 1185, 1231, 1262, 1318, 1356
Offset: 1

Views

Author

Wesley Ivan Hurt, Dec 31 2023

Keywords

Crossrefs

Programs

  • Mathematica
    Table[Sum[PrimePi[k - 1] Ceiling[n/k], {k, 2, n}], {n, 100}]

Formula

a(n) = A368610(n) - A092494(n).

A368613 a(n) = Sum_{k=2..n} pi(k-1) * floor(n/k).

Original entry on oeis.org

0, 0, 1, 3, 5, 9, 12, 18, 23, 29, 33, 44, 49, 58, 67, 79, 85, 100, 107, 123, 135, 147, 155, 179, 190, 204, 218, 238, 247, 273, 283, 306, 322, 339, 355, 388, 399, 418, 436, 468, 480, 514, 527, 555, 582, 604, 618, 663, 681, 711, 733, 764, 779, 819, 841, 881, 905, 930
Offset: 1

Views

Author

Wesley Ivan Hurt, Dec 31 2023

Keywords

Crossrefs

Programs

  • Mathematica
    Table[Sum[PrimePi[k - 1] Floor[n/k], {k, 2, n}], {n, 100}]

Formula

a(n) = A368611(n) - A013939(n).

A147693 Irregular triangle read by rows: T(n, k) = n mod prime(k), n >= 2, 1 <= k <= PrimePi(n), where PrimePi(n) = A000720(n).

Original entry on oeis.org

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

Views

Author

Reikku Kulon, Nov 10 2008

Keywords

Comments

Equivalently, we define table, P, with columns numbered by the primes (2, 3, 5, ...) instead of 1, 2, 3, ... so that P(n, p) = n mod p.
P begins with P(2, 2).
A complex pattern emerges if values in the triangle are taken modulo 2.
Rows are unique. Row n has length A000720(n). - Jason Kimberley, Nov 2012

Examples

			Triangle P begins:
       2 3 5 7
     +---------
   2 | 0
   3 | 1 0
   4 | 0 1
   5 | 1 2 0
   6 | 0 0 1
   7 | 1 1 2 0
   8 | 0 2 3 1
   9 | 1 0 4 2
  10 | 0 1 0 3
  ...
Each row can be produced from the previous row by adding one to each number and resetting to zero any which would equal their column number. A row number n is prime, initiating a new column numbered n, iff P(n, p) is nonzero for all prime p < n; P(n, n) is then 0.
		

References

  • James J. Tattersall, Elementary Number Theory in Nine Chapters, Cambridge University Press, 1999, Exercise 3.7.22 on page 125.

Crossrefs

Programs

  • Magma
    A147693 :=
    func< n | [n mod p:p in PrimesUpTo(n)] >;
    [A147693(n):n in[2..19]]; // Jason Kimberley, Nov 28 2012
  • Mathematica
    row[n_]:=Table[Mod[n,Prime[i]], {i, PrimePi[n]}]; Array[row, 20, 2]//Flatten (* Stefano Spezia, Jul 17 2025 *)

Formula

a(A046992(n-1)+i) = T(n,i) = n mod A000040(i), where 1 <= i <= A000720(n). - Jason Kimberley, Nov 21 2012

Extensions

Edited by Peter Munn, May 25 2025

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

A249728 After a(1) = 1 each n appears A000720(n) times.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Nov 06 2014

Keywords

Crossrefs

Programs

  • Mathematica
    Join[{1},Table[Table[n,PrimePi[n]],{n,20}]//Flatten] (* Harvey P. Dale, Nov 24 2018 *)
Previous Showing 11-20 of 29 results. Next