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 14 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

A061275 Smaller of two consecutive primes whose sum is a square.

Original entry on oeis.org

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

Views

Author

Amarnath Murthy, Apr 25 2001

Keywords

Examples

			a(4) = 283, the next prime is 293 and 283 + 293 = 576 = 24^2.
		

Crossrefs

Programs

  • Mathematica
    Transpose[Select[Partition[Prime[Range[20000]],2,1],IntegerQ[Sqrt[Plus@@# ]]&]][[1]] (* Harvey P. Dale, Aug 04 2009 *)
  • PARI
    { default(primelimit, 550655327); n=0; q=2; forprime (p=3, 550655327, if (issquare(p+q), write("b061275.txt", n++, " ", q)); q=p ) } \\ Harry J. Smith, Jul 20 2009

Formula

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

Extensions

More terms from Larry Reeves (larryr(AT)acm.org) and Asher Auel, May 15 2001
Offset changed from 0 to 1 by Harry J. Smith, Jul 20 2009

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

A179975 Smallest k such that k*10^n is a sum of two successive primes.

Original entry on oeis.org

5, 3, 1, 6, 6, 6, 14, 6, 9, 19, 21, 21, 42, 93, 21, 6, 11, 2, 12, 111, 37, 39, 63, 38, 42, 24, 15, 15, 60, 6, 39, 82, 47, 58, 337, 49, 72, 25, 34, 21, 6, 107, 128, 96, 20, 2, 63, 231, 70, 7, 62, 144, 28, 151, 157, 33, 98, 55, 134, 162, 87, 201, 124, 303, 64, 106, 130, 13, 43
Offset: 0

Views

Author

Zak Seidov, Aug 04 2010

Keywords

Comments

From Robert G. Wilson v, Aug 11 2010: (Start)
A179975 n's such that a(n)=1: 3, 335, ..., .
A179975 First occurrence of k: 3, 18, 2, ???, 1, 4, 50, 162, 9, 335, 17, 19, 68, 7, 27, ..., .
Records: 5, 6, 14, 19, 21, 42, 93, 111, 337, 449, 862, 1049, 1062, 1122, 1280, 2278, 3168, 4290, ..., . (End)

Examples

			a(0)=5 because 5=2+3
a(1)=3 because 30=13+17
a(2)=1 because 100=47+53
a(3)=6 because 6000=2999+3001.
		

Crossrefs

Programs

  • Mathematica
    Join[{5,3},Reap[Do[Do[n=10^m k; If[n==PreviousPrime[n/2]+NextPrime[n/2],Sow[k];Break[]],{k,2000}],{m,2,50}]][[2,1]]]
    f[n_] := Block[{k = 1, tn = 10^n}, While[h = k*tn/2; NextPrime[h, -1] + NextPrime@h != k*tn, k++ ]; k]; f[1] = 3; Array[f, 70, 0] (* Robert G. Wilson v, Aug 11 2010 *)

Extensions

More terms from Robert G. Wilson v, Aug 11 2010

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

Original entry on oeis.org

6, 12, 59, 65, 112, 965, 1029, 1455, 1706, 1830, 1890, 2573, 3457, 4490, 4664, 5609, 7927, 9130, 10078, 10143, 12597, 18248, 19727, 20086, 20887, 21708, 22739, 25041, 26536, 28511, 29346, 29664, 29774, 33387, 39945, 40677, 46136, 49869, 58135
Offset: 1

Views

Author

Zak Seidov, Oct 05 2002

Keywords

Comments

See A076304 for the square roots of the sums of the three primes.

Examples

			6 is a term because prime(6) + prime(7) + prime(8) = 13 + 17 + 19 = 49 = 7^2.
		

Crossrefs

Cf. A076304 (square roots of sums), A080665 (squares = sums), A206279 (lesser of the primes).
Cf. A064397 (same for 2 primes), A072849 (4 primes), A166255 (70 primes), A166261 (120 primes).

Programs

Formula

a(n) = A000720(A206279(n)). - M. F. Hasler, Jan 03 2020

Extensions

Corrected by Ray Chandler, Sep 26 2006

A072849 Prime(a(n)) + ... + prime(a(n)+3) is a square = A051395(n)^2.

Original entry on oeis.org

3, 21, 33, 84, 104, 199, 689, 1848, 1923, 3435, 3795, 3985, 4126, 4742, 5968, 6413, 6495, 7649, 8927, 9906, 16885, 17677, 20474, 20996, 22924, 23923, 36902, 38733, 40347, 40654, 41956, 42601, 43047, 44482, 44920, 51608, 52305, 56706, 66032
Offset: 1

Views

Author

Zak Seidov, Jun 21 2003

Keywords

Comments

Conjecture: this sequence and A064397 are disjoint. That is to say, prime(n) + prime(n+1) and prime(n) + prime(n+1) + prime(n+2) + prime(n+3) cannot be squares at the same time. - Jianing Song, Nov 13 2022

Examples

			a(1) = 3 because prime(3) + prime(4) + prime(5) + prime(6) = 5+7+11+13 = 36 = 6*6.
		

Crossrefs

Cf. A051395 (square root of sums), A206280 (primes), A000720.
Cf. A064397 (2 primes), A076305 (3 primes), A166255 (70 primes), A166261 (120 primes).

Programs

Formula

a(n) = A000720(A206280(n)). - Amiram Eldar, Jun 28 2024

Extensions

Definition corrected by Zak Seidov, Dec 13 2014

A166255 Numbers k with property that the sum of 70 successive primes starting with prime(k) is a square.

Original entry on oeis.org

71, 201, 1024, 1594, 10915, 36934, 51050, 60054, 60914, 71822, 80331, 85230, 92916, 96352, 103271, 114667, 151019, 158591, 183484, 184348, 193979, 196078, 223587, 277476, 295890, 309502, 317601, 334181, 338139, 369101, 485330, 494188, 530832
Offset: 1

Views

Author

Zak Seidov, Oct 10 2009

Keywords

Comments

Sum_{i=k..k+69} prime(i) = s^2; and the values of s are A166256.

Examples

			prime(71)+...+prime(71+69) = 200^2 = A166256(1)^2,
prime(201)+...+prime(201+69) = 322^2 = A166256(2)^2,
prime(1024)+...+prime(1024+69) = 770^2 = A166256(3)^2.
		

Crossrefs

Cf. A166256.
Cf. A064397 (2 primes), A076305 (3 primes), A072849 (4 primes), A166261 (120 primes).

Programs

  • Mathematica
    PrimePi[First[#]]&/@Select[Partition[Prime[Range[1000000]],70,1], IntegerQ[ Sqrt[ Total[#]]]&] (* Harvey P. Dale, Jun 13 2011 *)

A074925 Numbers n such that n^3 is a sum of two successive primes.

Original entry on oeis.org

2, 6, 28, 42, 72, 162, 174, 220, 222, 234, 246, 252, 296, 344, 380, 390, 486, 510, 584, 594, 638, 646, 674, 702, 720, 816, 828, 882, 942, 948, 990, 1044, 1056, 1146, 1200, 1314, 1422, 1436, 1554, 1566, 1596, 1602, 1632, 1740, 1770, 1778, 1806, 1818, 1824
Offset: 1

Views

Author

Zak Seidov, Oct 02 2002

Keywords

Comments

Prime(n)+ prime(n+1) as a square in A064397; n^2 as a sum of two successive primes in A074924; prime(n)+ prime(n+1) as a cube in A071220.

Examples

			6^3 = 216 = 107 + 109.
		

Crossrefs

Programs

  • Mathematica
    Surd[#,3]&/@Select[Total/@Partition[Prime[Range[150*10^6]],2,1], IntegerQ[ Surd[#,3]]&] (* Harvey P. Dale, Jun 05 2018 *)
  • Python
    from sympy import nextprime, prevprime
    A074925_list = [i for i in range(2,10**4,2) if prevprime(i**3//2) + nextprime(i**3//2) == i**3] # Chai Wah Wu, Feb 22 2017

Extensions

More terms from Zak Seidov, Jul 22 2009

A166261 Numbers k with property that the sum of 120 successive primes starting with prime(k) is a square.

Original entry on oeis.org

10917, 11527, 50923, 73894, 111468, 118436, 128662, 139123, 195234, 249281, 332863, 435489, 438080, 482557, 538373, 542299, 650254, 679958, 722145, 803501, 810871, 820409, 962582, 970711, 1003544, 1027732, 1030010, 1190134, 1204929, 1305603, 1636065, 1689410
Offset: 1

Views

Author

Zak Seidov, Oct 10 2009

Keywords

Comments

Corresponding values of s = sqrt(Sum_{i=k..k+119} prime(i)) are A166262.

Examples

			a(1) = 10917: Sum_{i=0..119} prime(10917+i) = 3734^2 = A166262(1)^2,
a(2) = 11527: Sum_{i=0..119} prime(11527+i) = 3846^2 = A166262(2)^2.
		

Crossrefs

Cf. A166262.
Cf. A064397 (2 primes), A076305 (3 primes), A072849 (4 primes), A166255 (70 primes).

Programs

  • Mathematica
    PrimePi/@Select[Partition[Prime[Range[169*10^4]],120,1],IntegerQ[ Sqrt[ Total[ #]]]&][[All,1]] (* Harvey P. Dale, Jan 22 2019 *)
  • PARI
    lista(nn) = {pr = primes(nn); for (i=1, nn-119, s = sum(k=i, i+119, pr[k]); if (issquare(s), print1(i, ", ")););} \\ Michel Marcus, Oct 15 2013
    
  • PARI
    S=vecsum(primes(119)); p=0; q=prime(120); for(n=1,oo, issquare(S+=q-p) && print1(n","); q=nextprime(q+1); p=nextprime(p+1)) \\ It is about 25% faster to avoid "nextprime(p)" at expense of keeping the last 120 primes used in a vector p, using {my(i=Mod(0,120)); ...p[lift(i)+1]... i++}. - M. F. Hasler, Jan 04 2020

Extensions

a(30)-a(32) from Michel Marcus, Oct 15 2013
Edited by M. F. Hasler, Jan 04 2020

A071220 Numbers n such that prime(n) + prime(n+1) is a cube.

Original entry on oeis.org

2, 28, 1332, 3928, 16886, 157576, 192181, 369440, 378904, 438814, 504718, 539873, 847252, 1291597, 1708511, 1837979, 3416685, 3914319, 5739049, 6021420, 7370101, 7634355, 8608315, 9660008, 10378270, 14797144, 15423070, 18450693
Offset: 1

Views

Author

Labos Elemer, May 17 2002

Keywords

Comments

The corresponding primes are in A061308; n^3 is a sum of two successive primes in A074925.
Prime(n)+ Prime(n+1) is a square in A064397; n^2 is a sum of two successive primes in A074924;

Examples

			28 is in the list because prime(28)+prime(29) = 107+109 =216 = 6^3.
n=1291597: prime(1291597)+prime(1291598) = 344*344*344.
		

Crossrefs

Programs

  • Mathematica
    PrevPrim[n_] := Block[{k = n - 1}, While[ !PrimeQ[k], k-- ]; k]; NextPrim[n_] := Block[{k = n + 1}, While[ !PrimeQ[k], k++ ]; k]; Do[ If[ n^3 == PrevPrim[Floor[(n^3)/2]] + NextPrim[Floor[(n^3)/2]], Print[ PrimePi[ Floor[(n^3)/2]]]], {n, 2, 10^4}]
    Flatten[Position[Total/@Partition[Prime[Range[20000000]],2,1],?(IntegerQ[ Surd[ #,3]]&)]] (* _Harvey P. Dale, May 28 2014 *)
  • Python
    from _future_ import division
    from sympy import isprime, prevprime, nextprime, primepi
    A071220_list, i = [], 2
    while i < 10**6:
        n = i**3
        m = n//2
        if not isprime(m) and prevprime(m) + nextprime(m) == n:
            A071220_list.append(primepi(m))
        i += 1 # Chai Wah Wu, May 31 2017

Formula

A001043(x)=m^3 for some m; if p(x+1)+p(x) is a cube, then x is here.
a(n) = primepi(A061308(n)). - Michel Marcus, Oct 24 2014

Extensions

Edited and extended by Robert G. Wilson v, Oct 07 2002
Showing 1-10 of 14 results. Next