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

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

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

A064397 Numbers k such that prime(k) + prime(k+1) is a square.

Original entry on oeis.org

7, 15, 20, 61, 152, 190, 293, 377, 492, 558, 789, 919, 942, 1768, 2343, 2429, 2693, 2952, 3136, 3720, 4837, 5421, 5722, 6870, 7347, 8126, 8193, 9465, 9857, 9927, 10410, 10483, 10653, 12685, 13763, 13955, 16033, 16342, 17859, 18367, 18474
Offset: 1

Views

Author

Jason Earls, Sep 29 2001

Keywords

Examples

			For k=15: prime(15) = 47 and prime(16) = 53, 47 + 53 = 100 = 10^2.
		

Crossrefs

Cf. A061275 (the primes), A062703 (squares), A074924 (square root of sum), A000720.
Cf. A076305 (3 primes), A072849 (4 primes), A166255 (70 primes), A166261 (120 primes).

Programs

  • Magma
    [n: n in [0..50000]| IsSquare(NthPrime(n) +NthPrime(n+1))]; // Vincenzo Librandi, Apr 06 2011
  • Mathematica
    lst={};Do[p1=Prime[n];p2=Prime[n+1];q=(p1+p2)^0.5;If[q==IntegerPart[q], AppendTo[lst, n]], {n, 1, 9!}];lst (* Vladimir Joseph Stephan Orlovsky, Sep 02 2008 *)
  • PARI
    j=[]; for(n=1,30000,x=prime(n)+prime(n+1); if(issquare(x),j=concat(j,n))); j
    
  • PARI
    { n=0; default(primelimit, 8500000); for (m=1, 10^9, if (issquare(prime(m) + prime(m + 1)), write("b064397.txt", n++, " ", m); if (n==175, break)) ) } \\ Harry J. Smith, Sep 13 2009
    

Formula

a(n) = A000720(A061275(n)). - Amiram Eldar, Jun 28 2024
a(n) >> n^2/log^2 n. - Charles R Greathouse IV, Mar 08 2025

A206279 Smallest of three consecutive primes whose sum is a square.

Original entry on oeis.org

13, 37, 277, 313, 613, 7591, 8209, 12157, 14557, 15679, 16267, 23053, 32233, 42953, 44887, 55213, 81013, 94687, 105649, 106397, 135241, 203317, 221401, 225769, 235747, 245941, 258707, 287671, 306541, 331333, 342049, 346111, 347443, 393853, 479191, 488827
Offset: 1

Views

Author

Harvey P. Dale, Feb 05 2012

Keywords

Examples

			a(4) = 313. The next two primes are 317 and 331, and 313 + 317 + 331 = 961 = 31^2.
		

Crossrefs

Programs

  • Mathematica
    Transpose[Select[Partition[Prime[Range[50000]],3,1],IntegerQ[ Sqrt[ Total[#]]]&]][[1]]
  • PARI
    p=2;q=3;forprime(r=5,1e9,if(issquare(p+q+r),print1(p", "));p=q;q=r) \\ Charles R Greathouse IV, Aug 28 2013

Formula

a(n) = A000040(A076305(n)). - Zak Seidov, Apr 07 2017

A061308 Smaller of two consecutive primes whose sum is a cube.

Original entry on oeis.org

3, 107, 10973, 37039, 186619, 2125757, 2634011, 5323949, 5470519, 6406447, 7443463, 8001491, 12967153, 20353771, 27435973, 29659499, 57395627, 66325487, 99588343, 104792291, 129847021, 134793059, 153090997, 172974199, 186623993, 271669247, 283831771, 343064479
Offset: 1

Views

Author

Amarnath Murthy, Apr 26 2001

Keywords

Examples

			a(2) = 107 as 107 + 109 = 216 = 6^3; a(3) = 10973 as 10973 + 10979 = 21952 = 28^3.
		

Crossrefs

Programs

  • Python
    from _future_ import division
    from sympy import prevprime, nextprime
    A061308_list = [prevprime(n**3//2) for n in range(2,10**4) if prevprime(n**3//2)+nextprime(n**3//2) == n**3] # Chai Wah Wu, Feb 11 2018

Formula

a(n) = prime(A071220(n)). - R. J. Mathar, Aug 11 2012

Extensions

More terms from Larry Reeves (larryr(AT)acm.org), May 15 2001

A206280 Smallest of four consecutive primes whose sum is a square.

Original entry on oeis.org

5, 73, 137, 433, 569, 1217, 5171, 15859, 16631, 32027, 35677, 37619, 39191, 45767, 59029, 63997, 65011, 77813, 92401, 103669, 186601, 196201, 230387, 237161, 261089, 273517, 439559, 463747, 484397, 488573, 505511, 514079, 519803, 538739, 544627, 633599
Offset: 1

Views

Author

Harvey P. Dale, Feb 05 2012

Keywords

Examples

			a(4) = 433. The next three primes are 439, 443, and 449, and the sum of those four primes = 1764 = 42^2.
		

Crossrefs

Programs

  • Mathematica
    Transpose[Select[Partition[Prime[Range[80000]],4,1],IntegerQ[Sqrt[ Total[#]]]&]][[1]]

Formula

a(n) = A000040(A072849(n)). - Amiram Eldar, Jun 28 2024

A091624 Lesser of consecutive primes whose sum is a perfect power (A001597).

Original entry on oeis.org

3, 17, 47, 61, 71, 107, 283, 881, 1151, 1913, 2591, 3527, 4049, 4093, 6047, 7193, 7433, 10973, 15137, 20807, 21617, 24197, 26903, 28793, 34847, 37039, 46817, 53129, 56443, 69191, 74489, 83231, 84047, 98563, 103049, 103967, 109507, 110441, 112337
Offset: 1

Views

Author

Robert G. Wilson v, Jan 24 2004

Keywords

Crossrefs

Cf. A071087.
Cf. A061275.

Programs

  • Mathematica
    NextPrim[n_] := Block[{k = n + 1}, While[ !PrimeQ[k], k++ ]; k]; PrimeExponents[n_] := Flatten[ Table[ #[[2]], {1}] & /@ FactorInteger[n]]; p = q = 2; l = {}; Do[q = NextPrim[p]; If[ Apply[ GCD, PrimeExponents[p + q]] > 1, AppendTo[l, p]]; p = q, {n, 2, 13000}]

A298462 The first of two consecutive triangular numbers the sum of which is equal to the sum of two consecutive prime numbers.

Original entry on oeis.org

15, 45, 66, 276, 861, 1128, 1891, 2556, 3486, 4005, 5995, 7140, 7381, 15051, 20706, 21528, 24090, 26796, 28680, 34716, 46665, 52975, 56280, 69006, 74305, 83028, 83845, 98346, 102831, 103740, 109278, 110215, 112101, 135981, 148785, 150975, 176121, 179700
Offset: 1

Views

Author

Colin Barker, Jan 19 2018

Keywords

Examples

			45 is in the sequence because 45+55 (consecutive triangular numbers) = 100 = 47+53 (consecutive primes).
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local p,q;
      p:= prevprime(floor((n+1)^2/2)); q:= nextprime(p);
      if p+q = (n+1)^2 then n*(n+1)/2 else NULL fi
    end proc:
    map(f, [$2..1000]); # Robert Israel, Jan 19 2018
  • PARI
    L=List(); forprime(p=2, 200000, q=nextprime(p+1); t=p+q; if(issquare(4*t, &sq) && (sq-2)%2==0, u=(sq-2)\2; listput(L, u*(u+1)/2))); Vec(L)

A298463 The first of two consecutive pentagonal numbers the sum of which is equal to the sum of two consecutive primes.

Original entry on oeis.org

70, 3577, 10795, 36895, 55777, 70525, 78547, 125137, 178365, 208507, 258130, 329707, 349692, 394497, 438751, 468442, 478555, 499105, 619852, 663005, 753667, 827702, 877455, 900550, 1025480, 1085876, 1169092, 1201090, 1211852, 1233520, 1339065, 1508512
Offset: 1

Views

Author

Colin Barker, Jan 19 2018

Keywords

Examples

			70 is in the sequence because 70+92 (consecutive pentagonal numbers) = 162 = 79+83 (consecutive primes).
		

Crossrefs

Programs

  • Mathematica
    Select[Partition[PolygonalNumber[5,Range[1500]],2,1],CompositeQ[Total[#]/2]&&Total[#] == NextPrime[ Total[#]/2]+NextPrime[Total[#]/2,-1]&][[;;,1]] (* Harvey P. Dale, Jan 20 2024 *)
  • PARI
    L=List(); forprime(p=2, 1600000, q=nextprime(p+1); t=p+q; if(issquare(12*t-8, &sq) && (sq-2)%6==0, u=(sq-2)\6; listput(L, (3*u^2-u)/2))); Vec(L)
    
  • Python
    from _future_ import division
    from sympy import prevprime, nextprime
    A298463_list, n, m = [], 1 ,6
    while len(A298463_list) < 10000:
        k = prevprime(m//2)
        if k + nextprime(k) == m:
            A298463_list.append(n*(3*n-1)//2)
        n += 1
        m += 6*n-1 # Chai Wah Wu, Jan 20 2018

A298464 The first of two consecutive primes the sum of which is equal to the sum of two consecutive pentagonal numbers.

Original entry on oeis.org

79, 3643, 10909, 37123, 56053, 70849, 78889, 125551, 178877, 209063, 258743, 330409, 350411, 395261, 439559, 469279, 479387, 499969, 620813, 663997, 754723, 828811, 878597, 901709, 1026709, 1087147, 1170397, 1202429, 1213189, 1234873, 1340477, 1510013
Offset: 1

Views

Author

Colin Barker, Jan 19 2018

Keywords

Examples

			79 is in the sequence because 79+83 (consecutive primes) = 162 = 70+92 (consecutive pentagonal numbers).
		

Crossrefs

Programs

  • Mathematica
    Block[{s = Total /@ Partition[PolygonalNumber[5, Range[10^3]], 2, 1], t}, t = Partition[Prime@ Range@ PrimePi[2 Last[s]], 2, 1]; Select[t, MemberQ[s, Total@ #] &][[All, 1]]] (* Michael De Vlieger, Jan 21 2018 *)
  • PARI
    L=List(); forprime(p=2, 1600000, q=nextprime(p+1); t=p+q; if(issquare(12*t-8, &sq) && (sq-2)%6==0, u=(sq-2)\6; listput(L, p))); Vec(L)
    
  • Python
    from _future_ import division
    from sympy import prevprime, nextprime
    A298464_list, n, m = [], 1 ,6
    while len(A298464_list) < 10000:
        k = prevprime(m//2)
        if k + nextprime(k) == m:
            A298464_list.append(k)
        n += 1
        m += 6*n-1 # Chai Wah Wu, Jan 20 2018
Showing 1-10 of 16 results. Next