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-5 of 5 results.

A082749 Difference between the sum of next prime(n) natural numbers and the sum of next n primes.

Original entry on oeis.org

1, 4, 9, 10, 54, 71, 191, 236, 446, 1025, 1310, 2259, 3245, 3820, 5048, 7321, 10060, 11473, 15328, 18358, 20381, 25672, 30222, 36561, 46367, 53031, 58108, 65444, 70971, 78391, 104184, 116542, 133095, 142728, 169931, 181324, 203429, 226622
Offset: 1

Views

Author

Amarnath Murthy, Apr 17 2003

Keywords

Comments

Group the natural numbers with prime(n) elements in each group. (1,2),(3,4,5),(6,7,8,9,10),(11,12,13,14,15,16,17),... The sum corresponding the groups is 3,12,40,98,... Group the prime numbers such that the n-th group contains n primes. (2),(3,5),(7,11,13),(17,19,23,29),... The sum corresponding the groups is 2,8,31,88,... The required difference is 1,4,9,10,...
The following sequences (allowing offset of first term) all appear to have the same parity: A034953, triangular numbers with prime indices; A054269, length of period of continued fraction for sqrt(p), p prime; A082749, difference between the sum of next prime(n) natural numbers and the sum of next n primes; A006254, numbers n such that 2n-1 is prime; A067076, 2n+3 is a prime. - Jeremy Gardiner, Sep 10 2004

Programs

  • Mathematica
    Module[{nn=80,trms=40,c,nat,pr},c=(nn(nn+1))/2;nat=Total/@TakeList[Range[c],Prime[Range[trms]]];pr=Total/@TakeList[Prime[Range[c]], Range[trms]]; Differences/@ Thread[{pr,nat}]]//Flatten (* Harvey P. Dale, Apr 13 2025 *)

Formula

a(n) = ((A061802(n-1) + 1)*A000040(n))/2 - A007468(n). - Gionata Neri, May 17 2015

Extensions

More terms from Ray Chandler, May 13 2003

A034960 Divide odd numbers into groups with prime(n) elements and add together.

Original entry on oeis.org

4, 21, 75, 189, 495, 897, 1683, 2565, 4071, 6641, 8959, 13209, 17835, 22317, 28623, 37577, 48439, 57401, 71623, 85697, 98623, 118737, 138195, 163493, 196231, 224321, 249775, 281945, 310759, 347249, 420751, 467801, 525943, 571985, 656047
Offset: 1

Views

Author

Patrick De Geest, Oct 15 1998

Keywords

Examples

			{1,3} #2 S=4;
{5,7,9} #3 S=21;
{11,13,15,17,19} #5 S=75;
{21,23,25,27,29,31,33} #7 S=189.
		

Crossrefs

Programs

  • Maple
    S:= n-> sum(ithprime(k), k=1..n): seq(S(n+1)^2-S(n)^2, n=0..40); # Gary Detlefs, Dec 20 2011
  • Mathematica
    Accumulate[Join[{2}, ListConvolve[{1, 1}, #]]]*# & [Prime[Range[50]]] (* Paolo Xausa, Jun 23 2025 *)
  • PARI
    a0(n) = vecsum(primes(n))^2 - vecsum(primes(n-1))^2; \\ Michel Marcus, Jun 16 2024
  • Python
    from itertools import islice
    from sympy import nextprime
    def A034960_gen(): # generator of terms
        a, p = 0, 2
        while True:
            yield p*((a<<1)+p)
            a, p = a+p, nextprime(p)
    A034960_list = list(islice(A034960_gen(),20)) # Chai Wah Wu, Mar 22 2023
    

Formula

From Hieronymus Fischer, Sep 26 2012: (Start)
a(n) = Sum_{k=A007504(n-1)+1..A007504(n)} (2*k-1).
a(n) = A007504(n)^2 - A007504(n-1)^2.
a(n) = 2*A034957(n) + A000040(n).
a(n) = 2*A034956(n) - A000040(n).
a(n) = A034959(n) + A000040(n). (End)
a(n) = A061802(n)*A000040(n). - Marco Zárate, May 12 2023

A138143 Triangle read by rows in which row n lists p(1), p(2), ..., p(n), p(n-1), ..., p(1), where p(i) = i-th prime.

Original entry on oeis.org

2, 2, 3, 2, 2, 3, 5, 3, 2, 2, 3, 5, 7, 5, 3, 2, 2, 3, 5, 7, 11, 7, 5, 3, 2, 2, 3, 5, 7, 11, 13, 11, 7, 5, 3, 2, 2, 3, 5, 7, 11, 13, 17, 13, 11, 7, 5, 3, 2, 2, 3, 5, 7, 11, 13, 17, 19, 17, 13, 11, 7, 5, 3, 2, 2, 3, 5, 7, 11, 13, 17, 19, 23, 19, 17, 13, 11, 7, 5, 3, 2, 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 23, 19, 17, 13, 11, 7, 5, 3, 2
Offset: 1

Views

Author

Omar E. Pol, Mar 09 2008

Keywords

Comments

Row n contains 2n-1 terms and each column lists the prime numbers A000040.
Triangle of primes mentioned in A061802.

Examples

			Triangle begins:
.............. 2
........... 2, 3, 2
........ 2, 3, 5, 3, 2
..... 2, 3, 5, 7, 5, 3, 2
.. 2, 3, 5, 7,11, 7, 5, 3, 2
		

Crossrefs

Programs

  • Mathematica
    nn=10;Module[{pr=Prime[Range[nn]],e},Flatten[Table[e=Take[pr,n];Join[ e,Reverse[Most[e]]],{n,nn}]]] (* Harvey P. Dale, Mar 14 2015 *)

Extensions

Edited by N. J. A. Sloane, Apr 07 2008, Nov 15 2008

A023662 Convolution of odd numbers and primes.

Original entry on oeis.org

2, 9, 24, 51, 96, 165, 264, 399, 576, 805, 1094, 1451, 1886, 2405, 3014, 3723, 4544, 5485, 6554, 7761, 9112, 10615, 12280, 14117, 16140, 18361, 20786, 23421, 26272, 29345, 32658, 36229, 40068, 44183, 48586, 53289, 58300, 63631, 69292
Offset: 1

Views

Author

Keywords

Crossrefs

Cf. A000040, A005408, A061802 (first differences).

Programs

  • Maple
    A023662 := proc(n)
        add( ithprime(n-i)*(2*i+1),i=0..n-1) ;
    end proc: # R. J. Mathar, Nov 29 2015
  • Mathematica
    Table[Sum[Prime[n - k + 1] (2 k - 1), {k, n}], {n, 39}] (* Michael De Vlieger, Nov 29 2015 *)
  • PARI
    a(n) = sum(i=1, n, prime(n-i+1)*(2*i-1)); \\ Michel Marcus, Sep 30 2013

Formula

a(n) = Sum_{i=0..n-1} A000040(n-i)*A005408(i). - R. J. Mathar, Nov 29 2015
a(n) = Sum_{i=0..n-1} A061802(i). - Marco Zárate, Jun 09 2024
From Ridouane Oudra, Feb 19 2025: (Start)
a(n) = Sum_{i=1..n} Sum_{j=1..n} min(prime(i), prime(j)).
a(n) = A167214(n) - A062020(n).
a(n) = 2*A167214(n) - A316322(n).
a(n) = A014148(n) + A014148(n-1).
a(n) = A007504(n) + 2*A014148(n-1). (End)

A073612 Group the positive integers as (1, 2), (3, 4, 5), (6, 7, 8, 9, 10), (11, 12, 13, 14, 15, 16, 17), ... the n-th group containing prime(n) elements. Except the first, all groups contain an odd number of elements and hence have a middle term. Sequence gives the middle terms starting from group 2.

Original entry on oeis.org

4, 8, 14, 23, 35, 50, 68, 89, 115, 145, 179, 218, 260, 305, 355, 411, 471, 535, 604, 676, 752, 833, 919, 1012, 1111, 1213, 1318, 1426, 1537, 1657, 1786, 1920, 2058, 2202, 2352, 2506, 2666, 2831, 3001, 3177, 3357, 3543, 3735, 3930, 4128, 4333, 4550, 4775
Offset: 2

Views

Author

Amarnath Murthy, Aug 05 2002

Keywords

Crossrefs

Programs

  • Mathematica
    Table[ Sum[ Prime[i], {i, 1, n}] - Floor[ Prime[n]/2], {n, 2, 50}]
    For[lst={}; n1=3; n=2, n<=100, n++, n2=n1+Prime[n]; AppendTo[lst, (n2+n1-1)/2]; n1=n2]; lst
    Module[{nn=50,no,pr},no=Total[Prime[Range[2,nn+1]]];pr=Prime[Range[2,nn]]; #[[ (Length[ #]+1)/2]]&/@TakeList[Range[3,no],pr]] (* Requires Mathematica version 11 or later *) (* Harvey P. Dale, Sep 20 2017 *)

Formula

Difference of the triangular numbers corresponding to the sum of first (n+1) primes and that of first n primes/prime(n) for n > 1.
a(n) = (A061802(n-1) + 1)/2. - Hugo Pfoertner, Apr 30 2021
a(n) = A007504(n) - (prime(n)-1)/2. - Andrew Howroyd, Apr 30 2021
a(n) = (Sum_{i=2..n-1} A001043(i)) / 2 + 4. - Christian Krause, May 06 2021

Extensions

Edited by Robert G. Wilson v and T. D. Noe, Aug 08 2002
Showing 1-5 of 5 results.