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

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

A245591 Cubes which are the sum of twin prime pairs.

Original entry on oeis.org

8, 216, 5268024, 59319000, 114791256, 209584584, 543338496, 970299000, 1137893184, 1177583616, 1505060136, 1728000000, 4065356736, 5545233000, 5890514616, 7011739944, 8947094976, 9340607016, 10941048000, 13824000000, 14996130696, 17293606056, 17657244864, 17902480896, 20480864256
Offset: 1

Views

Author

Derek Orr, Jul 26 2014

Keywords

Comments

All terms starting with 216 are multiples of 216 and final digits are 0, 4, 6. - Zak Seidov, Aug 03 2014

Examples

			3 and 5 are twin primes and 3 + 5 = 8 = 2^3. So 8 is a member of this sequence.
		

Crossrefs

Programs

  • PARI
    a(N) = for(n=1,N,p=n^3;if(nextprime(p/2)-precprime(p/2)==2&&precprime(p/2)+nextprime(p/2)==p,print1(p,", "))) \\ vary the program's range for any N

A227475 Cubes which are sum of three consecutive primes.

Original entry on oeis.org

1331, 103823, 3048625, 11089567, 12008989, 19034163, 30664297, 43986977, 48627125, 59776471, 62570773, 68417929, 130323843, 180362125, 182284263, 186169411, 188132517, 263374721, 288804781, 377933067, 498677257, 510082399, 594823321, 697864103, 716917375
Offset: 1

Views

Author

K. D. Bajpai, Sep 02 2013

Keywords

Examples

			a(2) = 103823 because prime(3696) + prime(3697) + prime(3698) = 34603 + 34607 + 34613 = 103823 = 47^3.
		

Crossrefs

Programs

  • Mathematica
    Select[Total[#]&/@Partition[Prime[Range[132*10^5]],3,1],IntegerQ[ Surd[ #,3]]&] (* Harvey P. Dale, May 08 2018 *)
  • PARI
    n=0; forstep(j=3, 86231, 2, c=j^3; c3=c/3; f=0; if(denominator(c3)==1, if(isprime(c3), if(precprime(c3-1)+c3+nextprime(c3+1)==c, f=1))); p2=precprime(c3); p1=precprime(p2-1); p3=nextprime(c3); p4=nextprime(p3+1); if(p1+p2+p3==c, f=1); if(p2+p3+p4==c, f=1); if(f==1, n++; write("b227475.txt", n " " c))) /* Donovan Johnson, Sep 02 2013 */

Formula

a(n) = (A076306(n))^3. - R. J. Mathar, Sep 02 2013

A245360 Perfect powers which are the sum of two consecutive primes.

Original entry on oeis.org

8, 36, 100, 128, 144, 216, 576, 1764, 2304, 3844, 5184, 7056, 8100, 8192, 12100, 14400, 14884, 21952, 30276, 41616, 43264, 48400, 53824, 57600, 69696, 74088, 93636, 106276, 112896, 138384, 148996, 166464, 168100, 197136, 206116, 207936, 219024, 220900, 224676, 272484, 279936
Offset: 1

Views

Author

Derek Orr, Jul 18 2014

Keywords

Examples

			47 + 53 = 100 = 10^2, so 100 is a member of this sequence.
		

Crossrefs

Programs

  • Mathematica
    Select[Total/@Partition[Prime[Range[13100]],2,1],GCD@@FactorInteger[#][[All,2]]>1&] (* Harvey P. Dale, Jan 22 2019 *)
  • PARI
    for(n=1,10^5,q=prime(n)+prime(n+1);if(ispower(q),print1(q,", ")))
    
  • PARI
    m=10^8; v=[]; forstep(b=2, sqrt(m), 2, forprime(p=2, 40, n=b^p; if(n>m,break); if(n==precprime(n/2)+nextprime(n/2+1), v=concat(v,n)))); v=vecsort(v) \\ Faster program. Jens Kruse Andersen, Jul 20 2014
Showing 1-4 of 4 results.