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

A073682 Prime sum of n-th group of successive primes in A073684.

Original entry on oeis.org

5, 23, 101, 109, 263, 211, 251, 757, 1367, 941, 2053, 1901, 911, 2347, 1861, 1187, 1249, 1303, 2273, 1433, 1493, 1553, 2777, 2927, 44843, 26699, 65713, 4597, 14159, 8069, 18439, 5197, 8819, 9011, 9277, 9419, 33599, 53381, 6761, 6823, 11497, 7013
Offset: 1

Views

Author

Amarnath Murthy, Aug 11 2002

Keywords

Comments

Partition the sequence of primes into groups so that the sum of the terms in each group is prime: {2, 3}, {5, 7, 11}, {13, 17, 19, 23, 29}, {31, 37, 41}, {43, 47, 53, 59, 61}, {67, 71, 73}, {79, 83, 89}, {97, 101, 103, 107, 109, 113, 127}, {131, 137, 139, 149, 151, 157, 163, 167, 173}, {179, 181, 191, 193, 197}, ...; A073684(n) is the number of terms in n-th group; A073682(n) is the sum of terms in n-th group; A073683(n) is the first term in n-th group; A077279(n) is the last term in n-th group.

Examples

			a(1)=5 because sum of first two primes 2+3 = 5 is prime;
a(2)=23 because sum of next three primes 5+7+11 = 23 is prime;
a(3)=101 because sum of next five primes 13+17+19+23+29 = 101 is prime.
		

Crossrefs

Programs

  • Python
    from itertools import count, islice
    from sympy import isprime, nextprime
    def agen(): # generator of terms
        s, i, p = 0, 1, 2
        while True:
            while not(isprime(s:=s+p)) or i < 2:
                i, p = i+1, nextprime(p)
            yield s
            s, i, p = 0, 1, nextprime(p)
    print(list(islice(agen(), 42))) # Michael S. Branicky, May 23 2025

Extensions

More terms from Gabriel Cunningham (gcasey(AT)mit.edu), Apr 10 2003

A077279 Last prime of n-th group of successive primes in A073684.

Original entry on oeis.org

3, 11, 29, 41, 61, 73, 89, 127, 173, 197, 251, 283, 311, 353, 383, 401, 421, 439, 463, 487, 503, 523, 569, 599, 983, 1153, 1511, 1543, 1601, 1621, 1721, 1741, 1783, 1823, 1871, 1901, 2029, 2239, 2267, 2281, 2311, 2341, 2383, 2447, 2503, 2539, 2551, 2591
Offset: 1

Views

Author

Zak Seidov, Nov 02 2002

Keywords

Comments

Partition the sequence of primes into groups so that the sum of the terms in each group is prime: {2, 3}, {5, 7, 11}, {13, 17, 19, 23, 29}, {31, 37, 41}, {43, 47, 53, 59, 61}, {67, 71, 73}, {79, 83, 89}, {97, 101, 103, 107, 109, 113, 127}, {131, 137, 139, 149, 151, 157, 163, 167, 173}, {179, 181, 191, 193, 197},..; A073684(n) is the number of terms in n-th group; A073682(n) is the sum of terms in n-th group; A073683(n) is the first term in n-th group; A077279(n) is the last term in n-th group.

Crossrefs

Programs

  • Python
    from itertools import count, islice
    from sympy import isprime, nextprime
    def agen(): # generator of terms
        s, i, p = 0, 1, 2
        while True:
            while not(isprime(s:=s+p)) or i < 2:
                i, p = i+1, nextprime(p)
            yield p
            s, i, p = 0, 1, nextprime(p)
    print(list(islice(agen(), 48))) # Michael S. Branicky, May 23 2025

A077276 Duplicate of A073684.

Original entry on oeis.org

2, 3, 5, 3, 5, 3, 3, 7, 9, 5, 9, 7, 3, 7, 5, 3, 3, 3, 5, 3, 3, 3, 5, 5, 57, 25, 49, 3, 9, 5, 11, 3, 5
Offset: 1

Views

Author

Keywords

A073683 Group the primes such that the sum of each group is a prime. Each group from the second onwards should contain at least 3 primes: (2, 3), (5, 7, 11), (13, 17, 19, 23, 29), (31, 37, 41), (43, 47, 53, 59, 61), ... This is the sequence of the leading element in each group.

Original entry on oeis.org

2, 5, 13, 31, 43, 67, 79, 97, 131, 179, 199, 257, 293, 313, 359, 389, 409, 431, 443, 467, 491, 509, 541, 571, 601, 991, 1163, 1523, 1549, 1607, 1627, 1723, 1747, 1787, 1831, 1873, 1907, 2039, 2243, 2269, 2287, 2333, 2347, 2389, 2459, 2521, 2543, 2557, 2593
Offset: 1

Views

Author

Amarnath Murthy, Aug 11 2002

Keywords

Comments

First prime of n-th group of successive primes in A073684.

Examples

			Partition the sequence of primes into groups so that the sum of the terms in each group is prime: {2, 3}, {5, 7, 11}, {13, 17, 19, 23, 29}, {31, 37, 41}, {43, 47, 53, 59, 61}, {67, 71, 73}, {79, 83, 89}, {97, 101, 103, 107, 109, 113, 127}, {131, 137, 139, 149, 151, 157, 163, 167, 173}, {179, 181, 191, 193, 197},..; A073684(n) is the number of terms in n-th group; A073682(n) is the sum of terms in n-th group; a(n) is the first term in n-th group; A077279(n) is the last term in n-th group.
		

Crossrefs

Programs

  • Python
    from itertools import count, islice
    from sympy import isprime, nextprime
    def agen(): # generator of terms
        s, i, p = 0, 1, 2
        while True:
            pp = p
            while not(isprime(s:=s+p)) or i < 2:
                i, p = i+1, nextprime(p)
            yield pp
            s, i, p = 0, 1, nextprime(p)
    print(list(islice(agen(), 49))) # Michael S. Branicky, May 23 2025

Extensions

More terms from Zak Seidov, Nov 02 2002

A214442 Arithmetic mean of next a(n) > 1 successive odd primes is prime.

Original entry on oeis.org

3, 18, 3318, 39193162, 943016093, 390502539, 3
Offset: 1

Views

Author

Alex Ratushnyak, Jul 18 2012

Keywords

Comments

Two or more primes in the arithmetic mean.
Corresponding prime arithmetic means: 5, 43, 14639, 369687067, 11370090223, 27055575571, 31756143437

Examples

			(3+5+7)/3 is prime, so a(1)=3; next (11+13+...+73+79)/18=43 is prime, so a(2)=18.
		

Crossrefs

Programs

  • Mathematica
    n = 1; Table[n++; s = Prime[n]; num = 1; While[num == 1 || ! PrimeQ[s/num], n++; num++; s = s + Prime[n]]; num, {3}] (* T. D. Noe, Jul 23 2012 *)

A214648 Sum of next a(n) > 1 triangular numbers is a triangular number.

Original entry on oeis.org

2, 5, 125, 51875, 8114028125
Offset: 1

Views

Author

Alex Ratushnyak, Jul 24 2012

Keywords

Comments

Two or more triangular numbers in the sum.
Sum of next a(n) oblong numbers is an oblong number: the same sequence.

Examples

			(0+1)=1 is a triangular number, so a(1)=2, then (3+6+10+15+21)=55 is a triangular number, so a(2)=5.
		

Crossrefs

Programs

  • Python
    from _future_ import division
    from gmpy2 import is_square
    A214648_list, s, c, d = [], 0, 0, -1
    for _ in range(10):
        k = 2
        q = 4*(k*(k*(k+c)+d))//3 + 1
        while not is_square(q):
            k += 1
            q = 4*(k*(k*(k+c)+d))//3 + 1
        A214648_list.append(k)
        s += k
        c, d = 3*s, 3*s**2-1 # Chai Wah Wu, Mar 01 2016

Formula

a(n) is the smallest integer k > 1 such that (4*k^3 + 12*s*k^2 + 4*(3*s^2-1)*k)/3 + 1 is a square, where s = a(1) + a(2) + ... + a(n-1). - Max Alekseyev, Jan 30 2014

A214696 Sum of next a(n) > 1 positive triangular numbers is a triangular number.

Original entry on oeis.org

3, 7, 13, 17, 4919, 73789919
Offset: 1

Views

Author

Alex Ratushnyak, Jul 26 2012

Keywords

Comments

Two or more triangular numbers in the sum.
Because an oblong number is twice a triangular number, this sequence also gives: the sum of next a(n) positive oblong numbers is an oblong number.

Examples

			1+3+6 = 10 is a triangular number, so a(1)=3, then 10+15+21+28+36+45+55 = 210 is a triangular number, seven summands, so a(2)=7.
		

Crossrefs

Formula

a(n) is the smallest integer k > 1 such that (4*k^3 + 12*s*k^2 + 4*(3*s^2-1)*k)/3 + 1 is a square, where s = 1 + a(1) + a(2) + ... + a(n-1). - Max Alekseyev, Jan 30 2014

A214874 Starting with Fibonacci(0), the sum of a(n) successive Fibonacci numbers is prime.

Original entry on oeis.org

3, 1, 1, 1, 5, 1, 5, 1, 5, 1, 11, 13, 131, 31, 65, 49, 47, 13, 2231, 389, 5269, 72211, 12587, 51193
Offset: 1

Views

Author

Alex Ratushnyak, Jul 28 2012

Keywords

Comments

a(22), if it exists, is bigger than 60300.
The sequence with corresponding primes begins: 2, 2, 3, 5, 131, 89, 2351, 1597, 42187, 28657, 14855327, 7763811697. The prime corresponding to a(21) = 5269 has 1729 decimal digits.

Examples

			0+1+1 = 2 is prime, three summands,
2 is prime,
3 is prime,
5 is prime,
8+13+21+34+55 = 131 is prime, five summands,
89 is prime,
144+233+377+610+987 = 2351 is prime, five summands,
1597 is prime.
		

Crossrefs

Programs

  • Java
    import static java.lang.System.out;
    import java.math.BigInteger;
    public class A214874 {
      public static void main (String[] args) {
        long i, n=0;
        BigInteger prpr = BigInteger.ZERO;
        BigInteger prev = BigInteger.ONE, curr;
        while (true) {
          BigInteger bsum = BigInteger.ZERO;
          for (i=n; ; ++i) {
            bsum = bsum.add(prpr);
            curr = prev.add(prpr);
            prpr = prev;
            prev = curr;
            if (bsum.isProbablePrime(2)) {
                    if (bsum.isProbablePrime(80)) break;
                    out.printf("(%d)",i);
            }
          }
          out.printf("%d, ", i+1-n);
          n=i+1;
        }
      }
    }

Extensions

a(22)-a(24) from Michael S. Branicky, Nov 21 2024

A383504 Sum of next a(n) successive prime squares is prime.

Original entry on oeis.org

2, 5, 7, 25, 11, 13, 7, 7, 35, 7, 19, 31, 25, 11, 5, 19, 5, 11, 5, 139, 37, 17, 19, 19, 13, 5, 7, 7, 19, 13, 11, 5, 7, 11, 5, 5, 5, 13, 47, 43, 5, 23, 13, 11, 11, 79, 31, 35, 5, 5, 25, 5, 37, 95, 31, 13, 43, 17, 5, 35, 17, 23, 11, 41, 59, 7, 47, 5, 13, 7, 11
Offset: 1

Views

Author

Abhiram R Devesh, May 18 2025

Keywords

Comments

Group the primes such that the sum of squares of members of each group is a prime, and each successive group is as short as possible.
Apart from a(1)=2, a(n) is odd and not a multiple of 3.

Examples

			Primes, their squares, and the lengths of blocks which sum to a prime begin,
  primes  2, 3,  5,  7,  11,  13,  17,  19, ...
  squared 4, 9, 25, 49, 121, 169, 289, 361, ...
          \--/  \-------------------/  \--- ...
  sum      13            653
  a(n) =    2             5
		

Crossrefs

Cf. A001248, A073684 (sum of successive primes), A384161 (sum of successive prime cubes).

Programs

  • Maple
    i:= 0: p:= 0: t:= 0: count:= 0: R:= NULL:
    while count < 100 do
      p:= nextprime(p);
      i:= i+1;
      t:= t + p^2;
      if isprime(t) then
        R:= R, i; count:= count+1; i:= 0; t:= 0;
      fi
    od:
    R; # Robert Israel, May 25 2025
  • Mathematica
    p=1;s={};Do[c=0;sm=0;While[!PrimeQ[sm],sm=sm+Prime[p]^2;p++;c++];AppendTo[s,c],{n,71}];s (* James C. McMahon, Jun 09 2025 *)
  • Python
    from itertools import count, islice
    from sympy import isprime, nextprime
    def agen(): # generator of terms
        s, i, p = 0, 1, 2
        while True:
            while not(isprime(s:=s+p**2)): i, p = i+1, nextprime(p)
            yield i
            s, i, p = 0, 1, nextprime(p)
    print(list(islice(agen(), 71))) # Michael S. Branicky, May 23 2025

A384161 Sum of next a(n) successive prime cubes is prime.

Original entry on oeis.org

4, 7, 3, 11, 13, 9, 131, 9, 15, 3, 31, 27, 3, 13, 7, 3, 31, 131, 15, 17, 13, 5, 21, 29, 3, 33, 3, 7, 11, 43, 5, 41, 43, 49, 27, 49, 37, 85, 5, 41, 3, 41, 65, 51, 13, 29, 65, 5, 89, 3, 27, 75, 3, 73, 3, 3, 5, 3, 23, 9, 7, 3, 71, 55, 35, 7, 71, 71, 19, 33, 15
Offset: 1

Views

Author

Abhiram R Devesh, May 20 2025

Keywords

Comments

Group the primes such that the sum of cubes of members of each group is a prime, and each successive group is as short as possible.

Examples

			Primes, their cubes and the lengths of the blocks when summed becomes a prime.
Primes 2,  3,   5,   7,   11,   13,   17,   19,    23,    29,    31,    37,    41
Cubes  8, 27, 125, 343, 1331, 2197, 4913, 6859, 12167, 24389, 29791, 50653, 68921
      \--------------/  \------------------------------------------/ \---...
Sum         503                           81647
a(n) =       4                              7
		

Crossrefs

Cf. A030078, A073684 (sum of successive primes), A383504 (sum of successive prime squares).

Programs

  • Maple
    i:= 0: p:= 0: t:= 0: count:= 0: R:= NULL:
    while count < 100 do
      p:= nextprime(p);
      i:= i+1;
      t:= t + p^3;
      if isprime(t) then
        R:= R, i; count:= count+1; i:= 0; t:= 0;
      fi
    od:
    R; # Robert Israel, May 25 2025
  • Mathematica
    p=1;s={};Do[c=0;sm=0;While[!PrimeQ[sm],sm=sm+Prime[p]^3;p++;c++];AppendTo[s,c],{n,71}];s (* James C. McMahon, Jun 09 2025 *)
  • Python
    from itertools import count, islice
    from sympy import isprime, nextprime
    def agen(): # generator of terms
        s, i, p = 0, 1, 2
        while True:
            while not(isprime(s:=s+p**3)): i, p = i+1, nextprime(p)
            yield i
            s, i, p = 0, 1, nextprime(p)
    print(list(islice(agen(), 71))) # Michael S. Branicky, May 23 2025
Showing 1-10 of 11 results. Next