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

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

A069495 Squares which are the arithmetic mean of two consecutive primes.

Original entry on oeis.org

4, 9, 64, 81, 144, 225, 324, 441, 625, 1089, 1681, 2601, 3600, 4096, 5184, 6084, 8464, 12544, 13689, 16641, 19044, 19600, 25281, 27225, 28224, 29584, 36864, 38025, 39204, 45369, 46656, 47524, 51984, 56169, 74529, 87025, 88804, 91809, 92416, 95481, 103684
Offset: 1

Views

Author

Amarnath Murthy, Mar 30 2002

Keywords

Examples

			144 = (139 + 149)/2 is a member.
		

Crossrefs

Intersection of A000290 and A024675.

Programs

  • Maple
    a:= proc(n) option remember; local k, kk, p, q;
          for k from 1 +`if`(n=1, 1, iroot(a(n-1), 2))
          do kk:= k^2; p, q:= prevprime(kk), nextprime(kk);
             if (p+q)/2=kk then return kk fi
          od
        end:
    seq(a(n), n=1..60);  # Alois P. Heinz, Dec 21 2013
  • Mathematica
    p = -1; Do[q = Prime[n]; If[ IntegerQ[ Sqrt[(p + q)/2]], Print[(p + q)/2]]; p = q, {n, 1, 10000} ]
    Select[Mean/@Partition[Prime[Range[11000]],2,1],IntegerQ[Sqrt[#]]&] (* Harvey P. Dale, Jan 23 2019 *)

Formula

a(n) = (A075190(n))^2. - Zak Seidov

Extensions

Edited and extended by Robert G. Wilson v, Apr 01 2002

A234240 Cubes which are arithmetic mean of two consecutive primes.

Original entry on oeis.org

64, 1728, 4096, 17576, 21952, 46656, 110592, 195112, 287496, 314432, 405224, 474552, 1061208, 1191016, 1404928, 1601613, 1906624, 2000376, 2146689, 2197000, 3241792, 3511808, 4913000, 5268024, 6229504, 6751269, 6859000, 7077888, 11239424, 20346417, 21952000
Offset: 1

Views

Author

K. D. Bajpai, Dec 21 2013

Keywords

Examples

			64 is in the sequence because cube 64 = 4^3 = (61+67)/2 is arithmetic mean of two consecutive primes.
1728 is in the sequence because 1728 = 12^3 = (1723+1733)/2.
		

Crossrefs

Programs

  • Maple
    a:= proc(n) option remember; local k, kk, p, q;
          for k from 1 +`if`(n=1, 1, iroot(a(n-1), 3))
          do kk:= k^3; p, q:= prevprime(kk), nextprime(kk);
             if (p+q)/2=kk then return kk fi
          od
        end:
    seq(a(n), n=1..60);  # Alois P. Heinz, Dec 21 2013
  • Mathematica
    Select[Mean/@Partition[Prime[Range[1500000]],2,1],IntegerQ[Surd[#,3]]&] (* Harvey P. Dale, Oct 08 2014 *)
    Select[Range[300]^3,#==Mean[{NextPrime[#],NextPrime[#,-1]}]&] (* Harvey P. Dale, Sep 02 2015 *)
  • PARI
    is(n)=nextprime(n)+precprime(n)==2*n && ispower(n,3)
    for(n=8,1e4,if(is(n^3), print1(n^3", "))) \\ Charles R Greathouse IV, Aug 25 2014

Formula

a(n) = A075191(n)^3.

A080665 Squares that are the sum of 3 consecutive primes.

Original entry on oeis.org

49, 121, 841, 961, 1849, 22801, 24649, 36481, 43681, 47089, 48841, 69169, 96721, 128881, 134689, 165649, 243049, 284089, 316969, 319225, 405769, 609961, 664225, 677329, 707281, 737881, 776161, 863041, 919681, 994009, 1026169, 1038361
Offset: 1

Views

Author

Cino Hilliard, Mar 02 2003

Keywords

Comments

Sum of reciprocals converges to 0.0317...

Examples

			13+17+19 = 49
		

Crossrefs

Cf. A062703.

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/3], t = 1}, If[PrimeQ[m], s = PrevPrim[m] + m + NextPrim[m], s = PrevPrim[ PrevPrim[m]] + PrevPrim[m] + NextPrim[m]; t = PrevPrim[m] + NextPrim[m] + NextPrim[ NextPrim[m]]]; If[s == n || t == n, True, False]]; Select[ Range[1020], f[ #^2] &]^2
  • PARI
    sump1p2p3sq(n)= {sr=0; forprime(x=2,n, y=x+nextprime(x+1)+nextprime(nextprime(x+1)+1); if(issquare(y),print1(y" "); sr+=1.0/y; ) ); print(); print(sr) }
    
  • PARI
    for(n=1,1e4,p=precprime(n^2/3);q=nextprime(p+1);t=n^2-p-q;if(isprime(t) && t==if(t>q,nextprime(q+1),precprime(p-1)), print1(n^2", "))) \\ Charles R Greathouse IV, May 26 2013

Formula

a(n) = A076304(n)^2. - Zak Seidov, May 26 2013

Extensions

Edited and extended by Robert G. Wilson v, Mar 02 2003
Offset corrected by Zak Seidov, May 26 2013

A226524 Cubes which are the sum of two consecutive primes.

Original entry on oeis.org

8, 216, 21952, 74088, 373248, 4251528, 5268024, 10648000, 10941048, 12812904, 14886936, 16003008, 25934336, 40707584, 54872000, 59319000, 114791256, 132651000, 199176704, 209584584, 259694072, 269586136, 306182024, 345948408, 373248000, 543338496, 567663552
Offset: 1

Views

Author

K. D. Bajpai, Aug 31 2013

Keywords

Examples

			a(2) = 216: prime(28) + prime(29) = 107 + 109 = 216 = 6^3.
		

Crossrefs

Cubes in A001043.
Cf. A062703 (analog for squares), A061308 (lesser of the consecutive primes), A071220 (index of that prime), A074925 (a(n)^(1/3)).

Programs

  • Maple
    KD: = proc() local a,b,c;  a: = ithprime(n) + ithprime(n+1); b:= evalf(a^(1/3)); if b=floor(b) then RETURN(a):  fi; end: seq(KD(), n=1..1000000);
  • Mathematica
    Select[Total/@Partition[Prime[Range[155*10^5]],2,1],IntegerQ[Surd[#,3]]&] (* or *) stcpQ[n_]:=Module[{p1=NextPrime[Floor[n/2],-1],p2=NextPrime[Ceiling[n/2]]},n==p1+p2]; Select[Range[850]^3,stcpQ] (* The second program is much more efficient than the first. *) (* Harvey P. Dale, May 15 2022 *)
  • PARI
    n=0; forstep(j=2, 55778, 2, c=j^3; c2=c/2; if(precprime(c2)+nextprime(c2)==c, n++; write("b226524.txt", n " " c))) /* Donovan Johnson, Sep 02 2013 */
    
  • PARI
    A226524(n)=A074925(n)^3 \\ M. F. Hasler, Jan 03 2020
    
  • Python
    from itertools import count, islice
    from sympy import nextprime, prevprime
    def agen(): yield from (c for c in (k**3 for k in count(2, step=2)) if prevprime(c//2+1) + nextprime(c//2-1) == c)
    print(list(islice(agen(), 27))) # Michael S. Branicky, May 24 2022

Formula

a(n) = A074925(n)^3 = A000040(i) + A000040(i+1) with i = A071220(n) = A000720(A061308(n)). - M. F. Hasler, Jan 03 2020

Extensions

Edited by M. F. Hasler, Jan 03 2020

A234297 Squares t^2 = (p+q+r)/3 which are the arithmetic mean of three consecutive primes such that p < t^2 < q < r.

Original entry on oeis.org

47961, 123201, 131769, 826281, 870489, 2486929, 3294225, 5239521, 5294601, 5774409, 6215049, 6335289, 6848689, 9308601, 10634121, 16072081, 17164449, 17732521, 18896409, 19298449, 22667121, 24413481, 25391521, 25836889, 30769209, 32569849, 33535681
Offset: 1

Views

Author

K. D. Bajpai, Dec 22 2013

Keywords

Examples

			47961 is in the sequence because 47961 = 219^2 = (47951+47963+47969)/3, the arithmetic mean of three consecutive primes.
131769 is in the sequence because 131769 = 363^2 = (131759+131771+131777)/3, the arithmetic mean of three consecutive primes.
		

Crossrefs

Cf. A000290 (squares: a(n) = n^2).
Cf. A062703 (squares: sum of two consecutive primes).
Cf. A069495 (squares: arithmetic mean of two consecutive primes).
Cf. A234240 (cubes: arithmetic mean of three consecutive primes).

Programs

  • Maple
    with(numtheory):KD := proc() local a,b,d,e,f; a:=n^2; b:=prevprime(a); d:=nextprime(a); e:=nextprime(d); f:=(b+d+e)/3; if a=f then RETURN (a); fi; end: seq(KD(), n=2..10000);
  • Mathematica
    amQ[{a_,b_,c_}]:=Module[{m=Mean[{a,b,c}]},IntegerQ[Sqrt[m]]&&aHarvey P. Dale, Mar 14 2014 *)
  • PARI
    list(lim)=my(v=List(),p=2,q=3,t); forprime(r=5, nextprime(nextprime(lim+1)+1), t=(p+q+r)/3; if(denominator(t)==1 && issquare(t) && t < q, listput(v, t)); p=q;q=r); Vec(v) \\ Charles R Greathouse IV, Jan 03 2014

Extensions

Definition corrected by Michel Marcus and Charles R Greathouse IV, Jan 03 2014

A234358 Cubes t^3 = (p+q+r+s)/4 which are the arithmetic mean of four consecutive primes such that p < t^3 < q < r < s.

Original entry on oeis.org

25934336, 194104539, 320013504, 332812557, 428661064, 8072216216, 8640364608, 11239424000, 16290480375, 17738739712, 26730899000, 44136677304, 46850670125, 68117264704, 114366627864, 119168121961
Offset: 1

Views

Author

K. D. Bajpai, Dec 24 2013

Keywords

Examples

			25934336 is in the sequence because 25934336 = 296^3 = (25934303+25934341+25934347+25934353)/4, the arithmetic mean of four consecutive primes.
320013504 is in the sequence because 320013504 = 684^3 = (320013479+320013509+320013511+320013517)/4, the arithmetic mean of four consecutive primes.
		

Crossrefs

Cf. A000578 (cubes: a(n) = n^3).
Cf. A062703 (squares: sum of two consecutive primes).
Cf. A069495 (squares: arithmetic mean of two consecutive primes).
Cf. A234240 (cubes: arithmetic mean of two consecutive primes).
Cf. A234256 (cubes: arithmetic mean of three consecutive primes).

Programs

  • Maple
    KD := proc() local a,b,d,e,f,g; a:=n^3; b:=prevprime(a); d:=nextprime(a); e:=nextprime(d); f:=nextprime(e); g:=(b+d+e+f)/4;  if a=g then RETURN (a);  fi; end: seq(KD(), n=2..10000);

Extensions

Definition corrected by K. D. Bajpai, Jan 07 2014

A203836 Smallest sum s of two consecutive primes such that s = 0 mod prime(n).

Original entry on oeis.org

8, 12, 5, 42, 198, 52, 68, 152, 138, 696, 186, 222, 410, 172, 564, 1272, 472, 1220, 268, 852, 1460, 2212, 1494, 712, 1164, 1818, 618, 1284, 872, 2486, 508, 786, 548, 1668, 1192, 906, 3768, 978, 668, 6228, 3222, 6516, 3820, 772, 4728, 3980, 6330, 892, 5448, 1374
Offset: 1

Views

Author

Zak Seidov, Jan 06 2012

Keywords

Comments

Besides a(3)=5, all terms are even and >=4. - Zak Seidov, Nov 29 2014

Examples

			a(1) = 8 = 3 + 5 is the least sum of two consecutive primes that is a multiple of prime(1) = 2.
a(3) = 5 = 2 + 3 is the least sum of two consecutive primes that is a multiple of prime(3) = 5.
		

Crossrefs

Cf. A001043, A062703, A111163, A247245, A247252, A188815 (the smaller prime), A118134.

Programs

  • Maple
    N := 100: # for a(1)..a(N)
    M := ithprime(N):
    V := Vector(M):
    count:= 0:
    for i from 1 while count < N do
      x:= ithprime(i)+ithprime(i+1);
      Q:= convert(select(t -> t <= M and V[t]=0, numtheory:-factorset(x)), list);
      V[Q]:= x;
      count:= count + nops(Q);
    od:
    seq(V[ithprime(i)], i=1..N); # Robert Israel, May 25 2020
  • Mathematica
    pr=Prime[Range[1000]];rm=Rest[pr]+Most[pr];Table[Select[rm,Mod[#,pr[[n]]]==0&][[1]],{n,50}]
    s = Total /@ Partition[Prime@ Range[10^4], 2, 1]; Table[SelectFirst[s, Divisible[#, Prime@ n] &], {n, 52}] (* Michael De Vlieger, Jul 04 2017 *)
  • PARI
    a(n)=p = 2; pn = prime(n); forprime(q=3, , if (((s=p+q) % pn) == 0, return (s)); p = q;); \\ Michel Marcus, Jul 04 2017
    
  • PARI
    isA001043(n)=precprime((n-1)/2)+nextprime(n/2)==n&&n>2
    a(n,p=prime(n))=if(p==5, return(5)); my(k=2); while(!isA001043(k*p), k+=2); k*p \\ Charles R Greathouse IV, Jul 05 2017

Formula

a(n) = 4*prime(n) if prime(n) is in A118134. - Robert Israel, May 25 2020

A234256 Cubes t^3 = (p+q+r)/3 which are the arithmetic mean of three consecutive primes such that p < t^3 < q < r.

Original entry on oeis.org

5735339, 10503459, 73560059, 253636137, 393832837, 761048497, 791453125, 1064332261, 1829276567, 2014698447, 2487813875, 2893640625, 4533086375, 7845011803, 14437662875, 45998156287, 55611739513, 62429032063, 63378025803, 72877493233, 87115050737, 104154702625
Offset: 1

Views

Author

K. D. Bajpai, Dec 22 2013

Keywords

Examples

			5735339 is in the sequence because 5735339 = 179^3 = (5735291+5735357+5735369)/3, the arithmetic mean of three consecutive primes.
10503459 is in the sequence because 10503459 = 219^3 = (10503443+10503461+10503473)/3, the arithmetic mean of three consecutive primes.
		

Crossrefs

Cf. A000578 (cubes: n^3).
Cf. A062703 (squares: sum of two consecutive primes).
Cf. A069495 (squares: arithmetic mean of two consecutive primes).
Cf. A234240 (cubes: arithmetic mean of two consecutive primes).

Programs

  • Maple
    with(numtheory):KD := proc() local a,b,d,e,f; a:=n^3; b:=prevprime(a); d:=nextprime(a); e:=nextprime(d);  f:=(b+d+e)/3; if  a=f then RETURN (a);  fi;  end: seq(KD(), n=2..10000);
  • PARI
    list(lim)=my(v=List(), p=2, q=3, t); forprime(r=5, nextprime(nextprime(lim\3+1)+1), t=(p+q+r)/3; if(denominator(t)==1 && ispower(t,3) && t < q, listput(v, t)); p=q; q=r); Vec(v) \\ Charles R Greathouse IV, Jan 03 2014

Extensions

Definition corrected by Michel Marcus and Charles R Greathouse IV, Jan 03 2014
Showing 1-10 of 14 results. Next