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 21-30 of 174 results. Next

A037165 a(n) = prime(n)*prime(n+1) - prime(n) - prime(n+1).

Original entry on oeis.org

1, 7, 23, 59, 119, 191, 287, 395, 615, 839, 1079, 1439, 1679, 1931, 2391, 3015, 3479, 3959, 4619, 5039, 5615, 6395, 7215, 8447, 9599, 10199, 10811, 11447, 12095, 14111, 16379, 17679, 18767, 20423, 22199, 23399, 25271, 26891, 28551, 30615, 32039
Offset: 1

Views

Author

Armand Turpel (armandt(AT)unforgettable.com)

Keywords

Comments

a(n) is also the Frobenius number of the numerical semigroup generated by prime(n) and prime(n+1). - Victoria A Sapko (vsapko(AT)math.unl.edu), Feb 21 2001

Crossrefs

Frobenius numbers for k successive primes: this sequence (k=2), A138989 (k=3), A138990 (k=4), A138991 (k=5), A138992 (k=6), A138993 (k=7), A138994 (k=8).

Programs

  • Magma
    [NthPrime(n)*NthPrime(n+1)-NthPrime(n)-NthPrime(n+1): n in [1..45]]; // Vincenzo Librandi, Dec 18 2012
    
  • Mathematica
    f[n_] := FrobeniusNumber[{Prime[n], Prime[n + 1]}]; Array[f, 41] (* Robert G. Wilson v, Aug 04 2012 *)
    Times@@#-Total[#]&/@Partition[Prime[Range[50]],2,1] (* Harvey P. Dale, Dec 27 2015 *)
  • PARI
    a(n)=my(p=prime(n),q=nextprime(p+1)); p*q-p-q \\ Charles R Greathouse IV, Apr 28 2015

Formula

a(n) = A006094(n) - A001043(n). - Michel Marcus, Mar 02 2019

A034964 Sums of five consecutive primes.

Original entry on oeis.org

28, 39, 53, 67, 83, 101, 119, 139, 161, 181, 199, 221, 243, 263, 287, 311, 331, 351, 373, 395, 421, 449, 473, 497, 517, 533, 559, 587, 617, 647, 683, 707, 733, 759, 787, 811, 839, 863, 891, 917, 941, 961, 991, 1023, 1057, 1089, 1123, 1151, 1169, 1193
Offset: 1

Views

Author

Patrick De Geest, Oct 15 1998

Keywords

Comments

Except for the first term, all terms are odd. - Alonso del Arte, Dec 30 2011

Examples

			a(1) = prime(1+0) + prime(1+1) + prime(1+2) + prime(1+3) + prime(1+4) = 2 + 3 + 5 + 7 + 11 = 28.
a(2) = prime(2+0) + prime(2+1) + prime(2+2) + prime(2+3) + prime(2+4) = 3 + 5 + 7 + 11 + 13 = 39.
		

References

  • Owen O'Shea and Underwood Dudley, The Magic Numbers of the Professor, Mathematical Association of America (2007), p. 62

Crossrefs

Cf. A131686 (sums of five consecutive squares of primes).

Programs

  • Magma
    [&+[ NthPrime(n+k): k in [0..4] ]: n in [1..100] ]; // Vincenzo Librandi, Apr 03 2011
    
  • Maple
    A034964:=n->add(ithprime(i), i=n..n+4): seq(A034964(n), n=1..50); # Wesley Ivan Hurt, Sep 14 2014
  • Mathematica
    Plus@@@Partition[Prime[Range[100]],5,1] (* Vladimir Joseph Stephan Orlovsky, Feb 18 2010 *)
  • PARI
    a(n) = sum(k=n, n+4, prime(k)); \\ Michel Marcus, Sep 03 2016
    
  • PARI
    first(n) = {my(psum = 28, pr = List([2,3,5,7,11]), res = List([28])); for(i=2,n, psum -= pr[1]; listpop(pr, 1); listput(pr, nextprime(pr[4] + 1)); psum += pr[5]; listput(res, psum)); res} \\ David A. Corneth, Oct 14 2017
  • Sage
    BB = primes_first_n(60)
    L = []
    for i in range(55):
        L.append(BB[i]+BB[i+1]+BB[i+2]+BB[i+3]+BB[i+4])
    L # Zerinvary Lajos, May 14 2007
    

Formula

a(n) = Sum_{i=n..n+4} prime(i). - Wesley Ivan Hurt, Sep 14 2014

Extensions

Offset changed to 1 by Joerg Arndt, Sep 04 2016

A074924 Numbers whose square is the sum of two successive primes.

Original entry on oeis.org

6, 10, 12, 24, 42, 48, 62, 72, 84, 90, 110, 120, 122, 174, 204, 208, 220, 232, 240, 264, 306, 326, 336, 372, 386, 408, 410, 444, 454, 456, 468, 470, 474, 522, 546, 550, 594, 600, 630, 640, 642, 686, 740, 750, 762, 766, 788, 802, 852, 876, 882, 920, 936, 970
Offset: 1

Views

Author

Zak Seidov, Oct 02 2002

Keywords

Examples

			6^2 = 17 + 19, 1610^2 = 1296041 + 1296059.
		

Crossrefs

Square roots of squares in A001043.
Cf. A062703 (the squares), A061275 (lesser of the primes), A064397 (index of that prime).
Cf. A064397 (numbers n such that prime(n) + prime(n+1) is a square), A071220 (prime(n) + prime(n+1) is a cube), A074925 (n^3 is sum of 2 consecutive primes).

Programs

  • Maple
    filter:= proc(n) local t; t:= n^2/2; prevprime(ceil(t)) + nextprime(floor(t)) = n^2 end proc:
    select(filter, [$3..1000]); # Robert Israel, Nov 19 2024
  • Mathematica
    Select[Sqrt[#]&/@(Total/@Partition[Prime[Range[50000]],2,1]),IntegerQ] (* Harvey P. Dale, Oct 04 2014 *)
    f@n_ := Sqrt@Select[(2*Range@n)^2, # == Plus @@ NextPrime[#/2, {-1, 1}] &]; f@485 (* Hans Rudolf Widmer, Nov 19 2024 *)
  • PARI
    is(n)=if(n%2, return(0)); nextprime(n^2/2+1)+precprime(n^2/2)==n^2 \\ Charles R Greathouse IV, Apr 29 2015
    
  • PARI
    select( {is_A074924(n)=!bittest(n=n^2,0) && precprime(n\2)+nextprime(n\/2)==n}, [1..999]) \\ M. F. Hasler, Jan 03 2020
    
  • PARI
    A74924=[6]; apply( A074924(n)={while(n>#A74924, my(N=A74924[#A74924]); until( is_A074924(N+=2),);A74924=concat(A74924,N));A74924[n]}, [1..99]) \\ M. F. Hasler, Jan 03 2020
    
  • Python
    from itertools import count, islice
    from sympy import nextprime, prevprime
    def agen(): # generator of terms
        for k in count(4, step=2):
            kk = k*k
            if prevprime(kk//2+1) + nextprime(kk//2-1) == kk:
                yield k
    print(list(islice(agen(), 54))) # Michael S. Branicky, May 24 2022

Formula

a(n) = sqrt(A062703(n)). - Zak Seidov, May 26 2013
a(n) = A000040(i) + A000040(i+1) with i = A064397(n) = A000720(A061275(n)). - M. F. Hasler, Jan 03 2020

Extensions

Crossrefs section corrected and extended by M. F. Hasler, Jan 03 2020

A011974 2 followed by the numbers that are the sum of 2 successive primes.

Original entry on oeis.org

2, 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

All the terms in the sequence, except for a(2), are even. - K. D. Bajpai, Aug 26 2014

Examples

			From _K. D. Bajpai_, Aug 26 2014: (Start)
a(6) = 24 is in the sequence because prime(5) + prime(6) = 11 + 13 = 24.
a(8) = 36 is in the sequence because prime(7) + prime(8) = 17 + 19 = 36.
(End)
		

References

  • Archimedeans Problems Drive, Eureka, 26 (1963), 12.

Crossrefs

Cf. A000040.

Programs

  • Mathematica
    Join[{2},Total/@Partition[Prime[Range[40]],2,1]] (* Harvey P. Dale, May 04 2013 *)

Formula

Essentially same as A001043.

Extensions

The terms a(40) to a(56) from K. D. Bajpai, Aug 26 2014

A096342 Primes of the form p*q + p + q, where p and q are two successive primes.

Original entry on oeis.org

11, 23, 47, 167, 251, 359, 479, 719, 1847, 2111, 2591, 3719, 6719, 7559, 8819, 10607, 12539, 14591, 19319, 27551, 29231, 31319, 51071, 53819, 68111, 97967, 149759, 155219, 172199, 177239, 195359, 199799, 234239, 273527, 305783, 314711, 339863
Offset: 1

Views

Author

Giovanni Teofilatto, Jun 29 2004

Keywords

Comments

a(n) == 3 mod 4.
Primes arising in A126148. - Jonathan Vos Post, Mar 08 2007
Number of primes <10^n: 0, 3, 8, 15, 26, 49, 99, 220, 514, 1228, 2991, 7746, 20218, 54081, ..., . - Robert G. Wilson v

Examples

			a(4)=167 because 11*13 + 11 + 13=167.
		

Crossrefs

Programs

  • Mathematica
    a = {}; Do[p = Prime[n]Prime[n + 1] + Prime[n] + Prime[n + 1]; If[ PrimeQ[p], AppendTo[a, p]], {n, 110}]; a (* Robert G. Wilson v, Jul 01 2004 *)
    Select[Times@@#+Total[#]&/@Partition[Prime[Range[200]],2,1],PrimeQ] (* Harvey P. Dale, Nov 25 2018 *)
  • PARI
    list(lim)=my(v=List(),p=2,t); forprime(q=3,, t=p*q+p+q; if (t>lim, return(Set(v))); if(isprime(t), listput(v,t)); p=q) \\ Charles R Greathouse IV, Sep 15 2015

Extensions

More terms from Robert G. Wilson v, Jul 02 2004

A034965 Primes that are sum of five consecutive primes.

Original entry on oeis.org

53, 67, 83, 101, 139, 181, 199, 263, 311, 331, 373, 421, 449, 587, 617, 647, 683, 733, 787, 811, 839, 863, 941, 991, 1123, 1151, 1193, 1361, 1381, 1579, 1609, 1801, 1831, 1861, 1949, 1979, 2081, 2113, 2143, 2221, 2273, 2297, 2357, 2423, 2459, 2689, 2731
Offset: 1

Views

Author

Patrick De Geest, Oct 15 1998

Keywords

Examples

			53 = 5 + 7 + 11 + 13 + 17.
373 = 67 + 71 + 73 + 79 + 83.
		

Crossrefs

Cf. A001043, A011974, A034707, A152468. Also Cf. A034964, of which this sequence is a subset.

Programs

  • Maple
    ts_prod_n:=proc(n) local i,ans; ans:=[ ]: for i from 1 to n do if isprime(ithprime(i)+ithprime(i+1)+ithprime(i+2)+ithprime(i+3)+ithprime(i+4))= 'true' then ans:=[op(ans), ithprime(i)+ithprime(i+1)+ithprime(i+2)+ithprime(i+3)+ithprime(i+4) ]: fi od: end: ts_prod_n(701); # Jani Melik, May 05 2006
  • Mathematica
    Select[Table[Plus@@Prime[Range[n, n + 4]], {n, 200}], PrimeQ] (* Alonso del Arte, Dec 30 2011 *)
    Select[Total/@Partition[Prime[Range[200]],5,1],PrimeQ] (* Harvey P. Dale, May 24 2012 *)

Extensions

Corrected example by Paul S. Coombes, Dec 29 2011

A062703 Squares that are the sum of two consecutive primes.

Original entry on oeis.org

36, 100, 144, 576, 1764, 2304, 3844, 5184, 7056, 8100, 12100, 14400, 14884, 30276, 41616, 43264, 48400, 53824, 57600, 69696, 93636, 106276, 112896, 138384, 148996, 166464, 168100, 197136, 206116, 207936, 219024, 220900, 224676, 272484, 298116, 302500, 352836
Offset: 1

Views

Author

Jason Earls, Jul 11 2001

Keywords

Examples

			prime(7) + prime(8) = 17 + 19 = 36 = 6^2.
		

Crossrefs

Squares in A001043. See A226524 for cubes.
Cf. A074924 (square roots), A061275 (lesser of the primes), A064397 (index of that prime).
Cf. A080665 (same with sum of three consecutive primes).

Programs

  • Mathematica
    PrevPrim[n_] := Block[{k = n - 1}, While[ !PrimeQ[k], k-- ]; k]; NextPrim[n_] := Block[{k = n + 1}, While[ !PrimeQ[k], k++ ]; k]; f[n_] := Block[{m = Floor[n/2]}, s = PrevPrim[m] + NextPrim[m]; If[s == n, True, False]]; Select[ Range[550], f[ #^2] &]^2
    t := Table[Prime[n] + Prime[n + 1], {n, 15000}]; Select[t, IntegerQ[Sqrt[#]] &] (* Carlos Eduardo Olivieri, Feb 25 2015 *)
  • PARI
    {for(n=1,100,(p=precprime(n^2/2))+nextprime(p+2) == n^2 && print1(n^2", "))} \\ Zak Seidov, Feb 17 2011
    
  • PARI
    A062703(n)=A074924(n)^2 \\ M. F. Hasler, Jan 03 2020
    
  • Python
    from itertools import count, islice
    from sympy import nextprime, prevprime
    def agen(): # generator of terms
        for k in count(4, step=2):
            kk = k*k
            if prevprime(kk//2+1) + nextprime(kk//2-1) == kk:
                yield kk
    print(list(islice(agen(), 37))) # Michael S. Branicky, May 24 2022

Formula

a(n) = A074924(n)^2.
a(n) = A000040(i) + A000040(i+1) with i = A064397(n) = A000720(A061275(n)). - M. F. Hasler, Jan 03 2020

Extensions

Edited by Robert G. Wilson v, Mar 02 2003
Edited (crossrefs completed, obsolete PARI code deleted) by M. F. Hasler, Jan 03 2020

A072669 Primes of the form prime(x) + prime(x+1) - 1.

Original entry on oeis.org

7, 11, 17, 23, 29, 41, 59, 67, 83, 89, 127, 137, 151, 197, 239, 257, 307, 359, 383, 389, 409, 433, 449, 461, 479, 491, 547, 557, 563, 599, 617, 647, 683, 701, 739, 751, 761, 797, 809, 827, 839, 863, 881, 929, 977, 1063, 1087, 1103, 1163, 1229, 1249, 1283, 1289, 1319, 1373
Offset: 1

Views

Author

Herman H. Rosenfeld (herm3(AT)pacbell.net), Aug 12 2002

Keywords

Comments

Consider m such that prime(m) + prime(m+1) = prime(k) + 1 for some k; sequence gives prime(k).
A118072 is a subsequence, hence this sequence is infinite on Dickson's conjecture. - Charles R Greathouse IV, Apr 18 2013

Crossrefs

Programs

  • Mathematica
    f[n_] := Prime[n] + Prime[n + 1] - 1; f[ # ] & /@ Select[ Range[120], PrimeQ[ f[ # ]] &] (* Robert G. Wilson v, Apr 14 2004 *)
    Select[Total[#]-1&/@Partition[Prime[Range[200]],2,1],PrimeQ] (* Harvey P. Dale, Aug 06 2012 *)
  • PARI
    p=2;forprime(q=3,1e6,if(isprime(p+q-1),print1(p+q-1", "));p=q) \\ Charles R Greathouse IV, Apr 18 2013

Extensions

Definition reworded by Jorge Coveiro, Apr 12 2004
Edited by N. J. A. Sloane, Sep 14 2008 at the suggestion of R. J. Mathar

A127337 Numbers that are the sum of 10 consecutive primes.

Original entry on oeis.org

129, 158, 192, 228, 264, 300, 340, 382, 424, 468, 510, 552, 594, 636, 682, 732, 780, 824, 870, 912, 954, 1008, 1060, 1114, 1164, 1216, 1266, 1320, 1376, 1434, 1494, 1546, 1596, 1650, 1704, 1752, 1800, 1854, 1914, 1974, 2030, 2084, 2142, 2192, 2250, 2310, 2374
Offset: 1

Views

Author

Artur Jasinski, Jan 11 2007

Keywords

Comments

a(n) is the absolute value of coefficient of x^9 of the polynomial Product_{j=0..9} (x - prime(n+j)) of degree 10; the roots of this polynomial are prime(n), ..., prime(n+9).

Crossrefs

Programs

  • Magma
    [&+[ NthPrime(n+k): k in [0..9] ]: n in [1..90] ]; // Vincenzo Librandi, Apr 03 2011
    
  • Maple
    A127337 := proc(n)
        local i ;
        add(ithprime(n+i),i=0..9) ;
    end proc:
    seq(A127337(n),n=1..30) ; # R. J. Mathar, Apr 24 2023
  • Mathematica
    a = {}; Do[AppendTo[a, Sum[Prime[x + n], {n, 0, 9}]], {x, 1, 50}]; a
    Table[Plus@@Prime[Range[n, n + 9]], {n, 50}] (* Alonso del Arte, Feb 15 2011 *)
    ListConvolve[ConstantArray[1, 10], Prime[Range[50]]]
    Total/@Partition[Prime[Range[60]],10,1] (* Harvey P. Dale, Jan 31 2013 *)
  • PARI
    {m=46;k=10;for(n=1,m,print1(a=sum(j=0,k-1,prime(n+j)),","))} \\ Klaus Brockhaus, Jan 13 2007
    
  • PARI
    {m=46;k=10;for(n=1,m,print1(abs(polcoeff(prod(j=0,k-1,(x-prime(n+j))),k-1)),","))} \\ Klaus Brockhaus, Jan 13 2007
    
  • Python
    from sympy import prime
    def a(n): return sum(prime(n + i) for i in range(10))
    print([a(n) for n in range(1, 48)]) # Michael S. Branicky, Dec 09 2021
    
  • Python
    # faster version for generating initial segment of sequence
    from sympy import nextprime
    def aupton(terms):
        alst, plst = [], [2, 3, 5, 7, 11, 13, 17, 19, 23, 29]
        for n in range(terms):
            alst.append(sum(plst))
            plst = plst[1:] + [nextprime(plst[-1])]
        return alst
    print(aupton(47)) # Michael S. Branicky, Dec 09 2021

Formula

a(n) = A127336(n)+A000040(n+9). - R. J. Mathar, Apr 24 2023

Extensions

Edited by Klaus Brockhaus, Jan 13 2007

A007443 Binomial transform of primes.

Original entry on oeis.org

2, 5, 13, 33, 83, 205, 495, 1169, 2707, 6169, 13889, 30993, 68701, 151469, 332349, 725837, 1577751, 3413221, 7349029, 15751187, 33616925, 71475193, 151466705, 320072415, 674721797, 1419327223, 2979993519, 6245693407, 13068049163
Offset: 1

Views

Author

Keywords

Comments

Equals row sums of triangle A164738. Example: a(4) = 33 = sum of terms in row 4 of triangle A164738: (2, 3, 5, 3, 5, 7, 5, 3). - Gary W. Adamson, Aug 23 2009
It might have been more natural to define this sequence with offset 0, which would also make the formula simpler. Then a(n) would be the first term of the sequence obtained from the primes by applying n times the operation "take sums of successive terms", Ts(k) = s(k)+s(k+1). - M. F. Hasler, Jun 02 2017

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A164738.
Cf. A001043, A096277, A096278, A096279. See A287915 for indices of primes.
First differences give A178167.

Programs

  • Maple
    a:=n->add(binomial(n-1,k-1)*ithprime(k),k=1..n): seq(a(n),n=1..30); # Muniru A Asiru, Oct 23 2018
  • Mathematica
    A007443[n_]:=Sum[Binomial[n-1,k-1]Prime[k],{k,n}];Array[A007443,50] (* or *)
    Module[{nmax=50,b},b=Prime[Range[nmax]];Join[{2},Table[First[b=ListConvolve[{1,1},b]],nmax-1]]] (* Paolo Xausa, Oct 31 2023 *)
  • PARI
    A007443(n)=sum(k=1,n,binomial(n-1,k-1)*prime(k)) \\ M. F. Hasler, Jun 02 2017

Formula

a(n) = Sum_{k=1..n} binomial(n-1,k-1)*prime(k). - M. F. Hasler, Jun 02 2017
G.f.: Sum_{k>=1} prime(k)*x^k/(1 - x)^k. - Ilya Gutkovskiy, Apr 21 2019

Extensions

More terms from Vladimir Joseph Stephan Orlovsky, May 21 2010
Previous Showing 21-30 of 174 results. Next