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

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

A076304 Numbers k such that k^2 is a sum of three successive primes.

Original entry on oeis.org

7, 11, 29, 31, 43, 151, 157, 191, 209, 217, 221, 263, 311, 359, 367, 407, 493, 533, 563, 565, 637, 781, 815, 823, 841, 859, 881, 929, 959, 997, 1013, 1019, 1021, 1087, 1199, 1211, 1297, 1353, 1471, 1573, 1613, 1683, 1685, 1733, 1735, 1739, 1751, 1761, 1769
Offset: 1

Views

Author

Zak Seidov, Oct 05 2002

Keywords

Examples

			7 is in this sequence because 7^2 = 49 = p(6) + p(7) + p(8) = 13 + 17 + 19.
		

Crossrefs

Cf. A206279 (smallest of the 3 primes), A076305 (index of that prime), A080665 (squares = sums), A122560 (subsequence of primes).
Cf. A034961.

Programs

  • Mathematica
    Select[Table[Sqrt[Sum[Prime[k], {k, n, n + 2}]], {n, 100000}], IntegerQ] (* Ray Chandler, Sep 29 2006 *)
    Select[Sqrt[#]&/@(Total/@Partition[Prime[Range[90000]],3,1]),IntegerQ]  (* Harvey P. Dale, Feb 23 2011 *)
  • PARI
    is(n, p=precprime(n^2/3), q=nextprime(p+1), t=n^2-p-q)=isprime(t) && t==if(t>q,nextprime(q+1),precprime(p-1)) \\ Charles R Greathouse IV, May 26 2013; edited by M. F. Hasler, Jan 03 2020
    
  • PARI
    A76304=[7]; apply( A076304(n)={if(n>#A76304, my(i=#A76304, N=A76304[i]); A76304=concat(A76304, vector(n-i,i, until( is(N+=2),);N))); A76304[n]}, [1..99]) \\ M. F. Hasler, Jan 03 2020

Formula

a(n) = sqrt(prime(i) + prime(i+1) + prime(i+2)) where i = A076305(n). [Corrected by M. F. Hasler, Jan 03 2020]

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

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 *)

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

A076306 Numbers k such that k^3 is a sum of three successive primes.

Original entry on oeis.org

11, 47, 145, 223, 229, 267, 313, 353, 365, 391, 397, 409, 507, 565, 567, 571, 573, 641, 661, 723, 793, 799, 841, 887, 895, 1015, 1051, 1089, 1293, 1297, 1411, 1451, 1469, 1789, 1909, 1943, 2043, 2077, 2171, 2401, 2459, 2497, 2671, 2801, 2851, 2871, 2921, 3211
Offset: 1

Views

Author

Zak Seidov, Oct 05 2002, Nov 12 2009

Keywords

Comments

prime(k) + prime(k+1) + prime(k+2) is a cube in A034961, k=A158796(n).

Examples

			11 is a term because 11^3 = 1331 = prime(85) + prime(86) + prime(87) = 439 + 443 + 449.
47 is a term because 47^3 = 103823 = prime(3696) + prime(3697) + prime(3698) = 34603 + 34607 + 34613.
		

Crossrefs

Programs

  • Mathematica
    okQ[n_]:=Module[{x=n^3,low,hi}, low=PrimePi[Round[x/3]]-4; hi=low+8; MemberQ[Total/@Partition[Prime[Range[low,hi]],3,1],x]]; Select[Range[5,3300],okQ]  (* Harvey P. Dale, Jan 27 2011 *)
  • PARI
    { p1=prime(1) ; p2=prime(2) ; p3=prime(3) ; n3=p1+p2+p3 ; for(i=1,100000000, if( ispower(n3,3,&n), print(n) ; ) ; n3 -= p1 ; p1=p2 ; p2=p3 ; p3=nextprime(p3+1) ; n3 += p3 ; ) ; } \\ R. J. Mathar, Jan 13 2007
    
  • 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("b076306.txt", n " " j))) /* Donovan Johnson, Sep 02 2013 */
    
  • Python
    from _future_ import division
    from sympy import nextprime, prevprime, isprime
    A070306_list, i = [], 3
    while i < 10**6:
        n = i**3
        m = n//3
        pm, nm = prevprime(m), nextprime(m)
        k = n - pm - nm
        if isprime(m):
            if m == k:
                A070306_list.append(i)
        else:
            if nextprime(nm) == k or prevprime(pm) == k:
                A070306_list.append(i)
        i += 1 # Chai Wah Wu, May 30 2017

Extensions

More terms from R. J. Mathar, Jan 13 2007
a(29)-a(48) from Donovan Johnson, Apr 27 2008
Edited by N. J. A. Sloane, Nov 12 2009 at the suggestion of R. J. Mathar

A230327 Index of smallest prime such that the sum of n consecutive primes starting with this specific prime is a square.

Original entry on oeis.org

7, 6, 3, 42, 107, 6, 38, 1, 1631, 170, 38, 119, 5, 546, 78, 309, 85, 604, 199, 57, 270, 2, 3, 333, 45, 2, 178, 1708, 291, 2, 35, 72, 322, 19, 84, 5, 155, 346, 122, 2175, 1395, 24, 886, 2, 3108, 168, 14, 499, 340, 294, 156, 578, 325, 240, 115, 61, 283, 1035
Offset: 2

Views

Author

Michel Marcus, Oct 16 2013

Keywords

Examples

			a(2)=7 because 17+19 (2 terms) = 36 is a square, 17 being the 7th prime.
a(3)=6 because 13+17+19 (3 terms) =49 is a square, 13 being the 6th prime.
		

Crossrefs

Cf. A064397 (2 primes), A076305 (3 primes), A072849 (4 primes), A166255 (70 primes), A166261 (120 primes).
Cf. A132955 (primes themselves), A132956 (squares=sums), A132957 (square roots of sums).

Programs

  • PARI
    a(n, lim=10^5) = {n --; pr = primes(lim); for (i = 1, lim-n, s = sum(k=i, i+n, pr[k]); if (issquare(s), return (i));); return (0);} \\ Michel Marcus, Oct 16 2013

A358156 a(n) is the smallest number k such that the sum of k consecutive prime numbers starting with the n-th prime is a square.

Original entry on oeis.org

9, 23, 4, 1862, 14, 3, 2, 211, 331, 163, 366, 3, 124, 48, 2, 449, 8403, 121, 35, 2, 4, 105, 77, 43, 190769, 1726, 234, 248, 200, 295, 293, 73, 4, 873, 32, 64, 2456139382, 8, 4519, 14, 123, 5, 9395, 296, 26, 5, 3479, 810, 9, 7091, 1669, 157, 1189, 12559, 269, 4930, 21, 376, 3
Offset: 1

Views

Author

Todor Szimeonov, Nov 01 2022

Keywords

Comments

a(60) > 10^10 and a(68) > 10^13. - Martin Ehrenstein, Nov 09 2022

Examples

			For n=7, prime(7) = 17 and starting there 2 primes 17 + 19 = 36 which is square, so that a(7)=2.
		

Crossrefs

Cf. A000040, A000290, A105720, A230327 (exchanges the roles of n, k), A287027 (squares reached).
Indices of terms: A064397 (2's), A076305 (3's), A072849 (4's), A166255 (70's), A166261 (120's).

Programs

  • Maple
    f:= proc(n) local p,s,k;
      p:= ithprime(n); s:= p;
      for k from 2 do
        p:= nextprime(p);
        s:= s+p;
        if issqr(s) then return k fi
      od
    end proc:
    map(f, [$1..36]); # Robert Israel, Nov 08 2022
  • Mathematica
    a[n_] := Module[{p = s = Prime[n], k = 1}, While[! IntegerQ[Sqrt[s]], p = NextPrime[p]; s += p; k++]; k]; Array[a, 36] (* Amiram Eldar, Nov 08 2022 *)

Extensions

a(25)-a(36) from Robert Israel, Nov 08 2022
a(37)-a(59) from Martin Ehrenstein, Nov 09 2022
Showing 1-9 of 9 results.