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

A001043 Numbers that are the sum of 2 successive primes.

Original entry on oeis.org

5, 8, 12, 18, 24, 30, 36, 42, 52, 60, 68, 78, 84, 90, 100, 112, 120, 128, 138, 144, 152, 162, 172, 186, 198, 204, 210, 216, 222, 240, 258, 268, 276, 288, 300, 308, 320, 330, 340, 352, 360, 372, 384, 390, 396, 410, 434, 450, 456, 462, 472, 480, 492, 508, 520
Offset: 1

Views

Author

Keywords

Comments

Arithmetic derivative (see A003415) of prime(n)*prime(n+1). - Giorgio Balzarotti, May 26 2011
A008472(a(n)) = A191583(n). - Reinhard Zumkeller, Jun 28 2011
With the exception of the first term, all terms are even. a(n) is divisible by 4 if the difference between prime(n) and prime(n + 1) is not divisible by 4; e.g., prime(n) = 1 mod 4 and prime(n + 1) = 3 mod 4. In general, for a(n) to be divisible by some even number m > 2 requires that prime(n + 1) - prime(n) not be a multiple of m. - Alonso del Arte, Jan 30 2012

Examples

			2 + 3 = 5.
3 + 5 = 8.
5 + 7 = 12.
7 + 11 = 18.
		

References

  • Archimedeans Problems Drive, Eureka, 26 (1963), 12.
  • 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

Subsequence of A050936.
Cf. A000040 (primes), A031131 (first differences), A092163 (bisection), A100479 (bisection).

Programs

  • Haskell
    a001043 n = a001043_list !! (n-1)
    a001043_list = zipWith (+) a000040_list $ tail a000040_list
    -- Reinhard Zumkeller, Oct 19 2011
  • Magma
    [(NthPrime(n+1) + NthPrime(n)): n in [1..100]]; // Vincenzo Librandi, Apr 02 2011
    
  • Maple
    Primes:= select(isprime,[2,seq(2*i+1,i=1..1000)]):
    n:= nops(Primes):
    Primes[1..n-1] + Primes[2..n]; # Robert Israel, Aug 29 2014
  • Mathematica
    Table[Prime[n] + Prime[n + 1], {n, 55}] (* Ray Chandler, Feb 12 2005 *)
    Total/@Partition[Prime[Range[60]], 2, 1] (* Harvey P. Dale, Aug 23 2011 *)
    Abs[Differences[Table[(-1)^n Prime[n], {n, 60}]]] (* Alonso del Arte, Feb 03 2016 *)
  • PARI
    p=2;forprime(q=3,1e3,print1(p+q", ");p=q) \\ Charles R Greathouse IV, Jun 10 2011
    
  • PARI
    is(n)=precprime((n-1)/2)+nextprime(n/2)==n&&n>2 \\ Charles R Greathouse IV, Jun 21 2012
    
  • Sage
    BB = primes_first_n(56)
    L = []
    for i in range(55): L.append(BB[1 + i] + BB[i])
    L # Zerinvary Lajos, May 14 2007
    

Formula

a(n) = prime(n) + prime(n + 1) = A000040(n) + A000040(n+1).
a(n) = A116366(n, n - 1) for n > 1. - Reinhard Zumkeller, Feb 06 2006
a(n) = 2*A024675(n-1), n>1. - R. J. Mathar, Jan 12 2024

Extensions

More terms from Larry Reeves (larryr(AT)acm.org), Mar 17 2000

A100479 a(n) = prime(2n-1) + prime(2n).

Original entry on oeis.org

5, 12, 24, 36, 52, 68, 84, 100, 120, 138, 152, 172, 198, 210, 222, 258, 276, 300, 320, 340, 360, 384, 396, 434, 456, 472, 492, 520, 540, 558, 576, 618, 630, 668, 696, 712, 740, 762, 786, 810, 840, 864, 882, 906, 924, 946, 978, 1002, 1030, 1064, 1104, 1132
Offset: 1

Views

Author

Jun Mizuki (suzuki32(AT)sanken.osaka-u.ac.jp), Nov 22 2004

Keywords

Crossrefs

Programs

  • Magma
    [(&+[NthPrime(2*n+j-1): j in [0..1]]): n in [1..70]]; // G. C. Greubel, Apr 05 2023
    
  • Maple
    A100479 := proc(n)
        ithprime(2*n-1)+ithprime(2*n) ;
    end proc:
    seq(A100479(n),n=1..50) ; # R. J. Mathar, Jan 20 2025
  • Mathematica
    Total/@Partition[Prime[Range[110]],2] (* Harvey P. Dale, Apr 20 2016 *)
  • SageMath
    [sum(nth_prime(2*n+j-1) for j in range(2)) for n in range(1, 71)] # G. C. Greubel, Apr 05 2023

Formula

a(n) = A001043(2n-1). - R. J. Mathar, Apr 20 2009
a(n) = A031368(n) + A031215(n). - G. C. Greubel, Apr 05 2023

A383938 a(n) is the least positive integer k such that b(2*j) is prime for 1 <= j <= n but not prime for j = n+1, where b(1) = k and b(m+1) = b(m) + prime(m) for m >= 1.

Original entry on oeis.org

2, 5, 21, 129, 69, 1, 51, 23991, 171, 1371, 3, 322141431, 1431357020859
Offset: 0

Views

Author

Om S. M. Yadav, Aug 18 2025

Keywords

Comments

Similar to A227547, primes are added in successive manner except that here the sequence breaks if an even-indexed term is not prime and considers preceding even-indexed prime as the last term of the sequence. For example, a(2) = 21 [21, 23, 26, 31, 38, 49] but since 49 is not prime, last two terms (38 and 49) are omitted leaving 31 as last term in the sequence.
a(12) is the last term, because b(j) is always divisible by 11 for some j in {2, 4, 6, 8, 10, 14, 16, 18, 22, 24, 26}. - Pontus von Brömssen, Aug 19 2025

Examples

			a(n) = k, b(m+1) = b(m) + prime(m); b(1) = k
For n = 0, a(0) = 2; b(m+1) = b(m) + prime(m): [2]
For n = 1, a(1) = 5; b(m+1) = b(m) + prime(m): [5, 7(5+2)]
For n = 2, a(2) = 21; b(m+1) = b(m) + prime(m): [21, 23(21+2), 26(23+3), 31(26+5)]
For n = 3, a(3) = 129; b(m+1) = b(m) + prime(m): [129, 131(129+2), 134(131+3), 139(134+5), 146(139+7), 157(146+11)]
For n = 4, a(4) = 69; b(m+1) = b(m) + prime(m): [69, 71(69+2), 74(71+3), 79(74+5), 86(79+7), 97(86+11), 110(97+13), 127(110+17)]
For n = 5, a(5) = 1; b(m+1) = b(m) + prime(m): [1, 3(1+2), 6(3+3), 11(6+5), 18(11+7), 29(18+11), 42(29+13), 59(42+17), 78(59+19), 101(78+23)]
For a(n), even-indexed term is prime. e.g. for a(3) = 129 [129, 131, 134, 139, 146, 157], even indexed terms 131, 139, 157 are primes.
		

Crossrefs

Programs

  • PARI
    a(n) = my(vp=concat(2, vector(n+1, i, sum(k=1, 2*i+1, prime(k)))), v=concat(vector(n, i, 1), 0), k=1); while (apply(ispseudoprime, vector(n+1, i, vp[i]+k)) != v, k++); k; \\ Michel Marcus, Aug 19 2025

Extensions

a(11) from Michel Marcus, Aug 19 2025
a(12) from Pontus von Brömssen, Aug 19 2025
Showing 1-3 of 3 results.