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

A139013 a(n) = A074924(n)/2.

Original entry on oeis.org

3, 5, 6, 12, 21, 24, 31, 36, 42, 45, 55, 60, 61, 87, 102, 104, 110, 116, 120, 132, 153, 163, 168, 186, 193, 204, 205, 222, 227, 228, 234, 235, 237, 261, 273, 275, 297, 300, 315, 320, 321, 343, 370, 375, 381, 383, 394, 401, 426, 438, 441, 460, 468, 485, 486, 489
Offset: 1

Views

Author

Zak Seidov, Apr 06 2008

Keywords

Crossrefs

Cf. A074924.

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

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

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

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

A152786 Integers k such that (k^2)/2 is the arithmetic mean of a pair of twin primes.

Original entry on oeis.org

6, 12, 42, 48, 72, 84, 90, 174, 204, 264, 306, 372, 408, 456, 474, 546, 594, 600, 642, 750, 852, 882, 936, 972, 978, 1038, 1140, 1212, 1272, 1386, 1470, 1512, 1518, 1584, 1770, 1836, 1902, 1980, 1986, 2130, 2196, 2256, 2262, 2316, 2382, 2652, 2688, 2718
Offset: 1

Views

Author

Keywords

Comments

Square roots of A054735 where these are integer.

Examples

			6 is a term since (6^2)/2 = 18 = mean(17, 19).
12 is a term since (12^2)/2 = 72 = mean(71,73).
42 is a term since (42^2)/2 = 882 = mean(881,883).
		

Crossrefs

Cf. A014574, A037073, A054735, A152788 (cubic version).
Subsequence of A074924. - Zak Seidov, Feb 01 2013

Programs

  • Magma
    [k:k in [2..2800 by 2]| IsPrime(k*k div 2 -1) and IsPrime(k*k div 2 +1)]; // Marius A. Burtea, Jan 01 2020
  • Maple
    isa := n -> isprime(n) and isprime(n+2) and issqr(2*n+2):
    select(isa, [$4..1000000]): map(n -> sqrt(2*n+2), %); # Peter Luschny, Jan 05 2020
  • Mathematica
    lst={};Do[p1=Prime[n];p2=Prime[n+1];If[p2-p1==2,e=(2*(p1+1))^(1/2);i=Floor[e]; If[e==i,AppendTo[lst,i]]],{n,3*9!}];lst
    (* Second program: *)
    Select[Map[Sqrt[2 #] &, Mean /@ Select[Partition[Prime@ Range[10^6], 2, 1], Subtract @@ # == -2 &]], IntegerQ] (* Michael De Vlieger, Feb 18 2018 *)
  • PARI
    forstep(n=6,1e3,6,if(isprime(n^2/2-1)&&isprime(n^2/2+1),print1(n", "))) \\ Charles R Greathouse IV, Feb 01 2013
    

Formula

{n: n^2 = A054735(i), any i}. - R. J. Mathar, Dec 12 2008
a(n) = 6*A037073(n). [Zak Seidov, seqfan list, Aug 20 2010] [From R. J. Mathar, Sep 07 2010]

Extensions

Edited by R. J. Mathar, Dec 12 2008

A252018 Numbers n such that n^2 is a sum of 6 consecutive primes.

Original entry on oeis.org

60, 156, 160, 218, 258, 314, 360, 372, 478, 486, 576, 616, 636, 700, 748, 832, 1070, 1108, 1152, 1250, 1564, 1614, 1636, 1644, 1686, 1710, 1738, 1846, 1862, 1878, 1924, 2010, 2060, 2062, 2156, 2182, 2376, 2490, 2530, 2748, 2754, 2774, 2824, 2826, 2834, 2860, 2896, 2902
Offset: 1

Views

Author

Zak Seidov, Dec 14 2014

Keywords

Examples

			60^2 = 3600 = prime(107) + ... + prime(112) = 587 + 593 + 599 + 601 + 607 + 613,
156^2 = 24336 = prime(557) + ... + prime(562) = 4027 + 4049 + 4051 + 4057 + 4073 + 4079.
		

Crossrefs

Programs

  • Mathematica
    Select[Sqrt[#]&/@(Total/@Partition[Prime[Range[150000]],6,1]),IntegerQ] (* Harvey P. Dale, Aug 02 2021 *)

A252066 Numbers n such that n^2 is a sum of 2 and also of 4 consecutive primes.

Original entry on oeis.org

6, 24, 42, 48, 1326, 1676, 2772, 4428, 4820, 4940, 5328, 5472, 6318, 9950, 10074, 12942, 13724, 14372, 16290, 18428, 22776, 22818, 23800, 23952, 25134, 28614, 28800, 31212, 31394, 32060, 33716, 36526, 37320, 39228, 39446, 39528, 43670, 43798, 44490, 45570, 47700, 48000
Offset: 1

Views

Author

Zak Seidov, Dec 13 2014

Keywords

Examples

			6^2=36=17+19=5+7+11+13, 18^2=324=157+163=73+79+83+89.
		

Crossrefs

Intersection of A051395 and A074924.

Programs

  • Mathematica
    Module[{nn=10^7,p2,p4},p2=Total/@Partition[Prime[Range[nn]],2,1];p4=Total/@Partition[ Prime[Range[nn]],4,1];Select[Sqrt[Intersection[p2,p4]],IntegerQ]] (* The program generates the first 20 terms of the sequence. *) (* Harvey P. Dale, May 03 2024 *)

A252019 Numbers n such that n^2 is a sum of 2, 4 and 6 consecutive primes.

Original entry on oeis.org

4820, 69636, 97058, 405888, 454086, 585828, 656490, 711282, 717486, 1161132, 1348582, 1560352, 1564810, 1625370, 1811262, 1838510, 1926224, 2446248, 2601094, 2670318, 2699918, 2961770, 2966112, 3234498, 3372694, 3387258, 3705880, 3860232, 3980524, 4104264, 4147330
Offset: 1

Views

Author

Zak Seidov, Dec 14 2014

Keywords

Comments

All terms are even. - Michel Marcus, Jul 07 2015

Crossrefs

Intersection of A051395, A074924 and A252018.
Also, intersection of A252066 and A252018.
Showing 1-10 of 21 results. Next