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

A235725 Values k(i) such that k(i) + k(i+3) = k(i+1) + k(i+2), where k(i) is A022885(i).

Original entry on oeis.org

5, 353, 541, 853, 2341, 4217, 4229, 8219, 10663, 11047, 13591, 18593, 21577, 28387, 30181, 34457, 37853, 52021, 55333, 57203, 75389, 84431, 93229, 110603, 120811, 147451, 153499, 162907, 166357, 176797, 179581, 219953, 243671, 246203, 307253, 342037, 359701
Offset: 1

Views

Author

Vladimir Shevelev, Jan 15 2014

Keywords

Examples

			Four consecutive Kimberling primes(A022885), beginning with 5 are 5,7,11,13. Since 5+13 = 7+11, then 5 is in the sequence; four consecutive Kimberling primes, beginning with 7 are 7,11,13,23. Since 7+23 is not equal to 11+13, then 7 is not in the sequence.
		

Crossrefs

Cf. A022885.

Programs

  • Mathematica
    Nest[Map[#[[1]]&,Select[Partition[#,4,1],#[[1]]+#[[4]]==#[[2]]+#[[3]]&]]&,Prime[Range[5000]],2]
  • PARI
    isA022885(p) = {my(k = primepi(p)); (p == prime(k)) && ((prime(k) + prime(k+3)) == (prime(k+1) + prime(k+2)));}
    lista(nn) = {prm = primes(nn); vkp = select(p->isA022885(p), prm); for(n=1, #vkp-3, if ((vkp[n] + vkp[n+3]) == (vkp[n+1] + vkp[n+2]), print1(vkp[n], ", ")););}  \\ Michel Marcus, Jan 15 2014

Extensions

a(5)-a(37) from Giovanni Resta, Jan 15 2014

A064101 Primes p = prime(k) such that prime(k) + prime(k+5) = prime(k+1) + prime(k+4) = prime(k+2) + prime(k+3).

Original entry on oeis.org

5, 7, 19, 31, 97, 131, 151, 293, 587, 683, 811, 839, 857, 907, 1013, 1097, 1279, 2347, 2677, 2833, 3011, 3329, 4217, 4219, 5441, 5839, 5849, 6113, 8233, 8273, 8963, 9433, 10301, 10427, 10859, 11953, 13513, 13597, 13721, 13931, 14713, 15629, 16057
Offset: 1

Views

Author

Robert G. Wilson v, Sep 17 2001

Keywords

Examples

			The first ten primes are 2, 3, 5, 7, 11, 13, 17, 19, 23 and 29. Take just the fourth through the ninth and rearrange them such that the first pairs with the sixth, the second with the fifth and the third with the fourth as follows: 7 and 23, 11 and 19 and 13 and 17. All three pairs sum to 30. Therefore a(2) = 7.
		

Crossrefs

Programs

  • Maple
    A := {}: for n to 1000 do p1 := ithprime(n); p2 := ithprime(n+1); p3 := ithprime(n+2); p4 := ithprime(n+3); p5 := ithprime(n+4); p6 := ithprime(n+5); if `and`(p1+p6 = p2+p5, p2+p5 = p3+p4) then A := `union`(A, {p1}) end if end do; A := A;
  • Mathematica
    a = {0, 0, 0, 0, 0, 0}; Do[ a = Delete[ a, 1 ]; a = Append[ a, Prime[ n ] ]; If[ a[ [ 1 ] ] + a[ [ 6 ] ] == a[ [ 2 ] ] + a[ [ 5 ] ] == a[ [ 3 ] ] + a[ [ 4 ] ], Print[ a[ [ 1 ] ] ] ], {n, 1, 20000} ] (* RGWv *)
    Prime[Select[Range[100], Prime[#] + Prime[# + 5] == Prime[# + 1] + Prime[# + 4] && Prime[#] + Prime[# + 5] == Prime[# + 2] + Prime[# + 3] &]]
    Select[Partition[Prime[Range[2000]],6,1],#[[1]]+#[[6]]==#[[2]]+#[[5]] == #[[3]]+ #[[4]]&][[All,1]] (* Harvey P. Dale, Jan 16 2022 *)
  • PARI
    { n=0; default(primelimit, 1500000); for (k=1, 10^9, p1=prime(k) + prime(k + 5); p2=prime(k + 1) + prime(k + 4); p3=prime(k + 2) + prime(k + 3); if (p1==p2 && p2==p3, write("b064101.txt", n++, " ", prime(k)); if (n==1000, break)) ) } \\ Harry J. Smith, Sep 07 2009

Formula

Primes p = prime(k) = A000040(k) such that A359440(k+2) >= 2. - Peter Munn, Jan 09 2023

A022884 Numbers k such that prime(k) + prime(k+3) = prime(k+1) + prime(k+2).

Original entry on oeis.org

3, 4, 5, 6, 9, 12, 16, 21, 25, 26, 27, 29, 33, 37, 41, 43, 48, 54, 56, 63, 71, 74, 77, 80, 81, 84, 88, 92, 93, 100, 103, 105, 108, 124, 125, 126, 134, 140, 142, 147, 149, 151, 153, 156, 165, 171, 175, 176, 181, 185, 191, 200, 208, 211, 216, 224, 234, 235
Offset: 1

Views

Author

Keywords

Examples

			The ninth prime is 23. We verify that 23 + 37 = 60 = 29 + 31. Hence 9 is in the sequence.
The tenth prime is 29. We see that 29 + 41 = 70 but 31 + 37 = 68, so 10 is not in the sequence.
		

Crossrefs

Cf. A261470. - Altug Alkan, Oct 28 2015

Programs

  • Magma
    [n: n in [1..250] |(NthPrime(n)+NthPrime(n+3)) eq (NthPrime(n+1)+ NthPrime(n+2))]; // Vincenzo Librandi, Nov 04 2018
  • Mathematica
    Select[Range@ 240, Prime[#] + Prime[# + 3] == Prime[# + 1] + Prime[# + 2] &] (* Michael De Vlieger, Oct 28 2015 *)
  • PARI
    isok(k) = prime(k+3)+prime(k) == prime(k+1)+prime(k+2); \\ Michel Marcus, Aug 20 2015
    
  • PARI
    is(n,p=prime(n))=my(q=nextprime(p+1),r=nextprime(q+1),s=nextprime(r+1)); p+s==q+r
    n=0; forprime(p=2,1e5, if(is(n++,p), print1(n", "))) \\ Charles R Greathouse IV, Oct 28 2015
    

Formula

a(n) = A000720(A022885(n)). - Zak Seidov, Oct 23 2015

Extensions

Name edited by Michel Marcus, Aug 20 2015

A105093 Numbers n such that n = prime(k) + prime(k+3) = prime(k+1) + prime(k+2) for some k.

Original entry on oeis.org

18, 24, 30, 36, 60, 84, 120, 162, 204, 210, 216, 240, 288, 330, 372, 390, 456, 520, 540, 624, 726, 762, 798, 840, 852, 882, 924, 978, 990, 1104, 1140, 1164, 1200, 1392, 1410, 1428, 1530, 1632, 1650, 1716, 1740, 1764, 1794, 1848, 1974, 2052, 2100, 2112, 2184
Offset: 1

Views

Author

Giovanni Teofilatto, Apr 06 2005

Keywords

Examples

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

Crossrefs

Cf. A001172, A000954, first primes in A022885.

Programs

  • Mathematica
    lst = {}; Do[ If[ Prime[n] + Prime[n + 3] == Prime[n + 1] + Prime[n + 2], AppendTo[lst, Prime[n] + Prime[n + 3]]], {n, 184}]; lst (* Robert G. Wilson v, Apr 07 2005 *)
  • Python
    from sympy import nextprime
    A105093_list, plist = [], [2,3,5,7]
    while len(A105093_list) < 10000:
        m = plist[0]+plist[3]
        if m == plist[1]+plist[2]:
            A105093_list.append(m)
        plist = plist[1:] + [nextprime(plist[-1])] # Chai Wah Wu, Mar 30 2020

Extensions

Edited and extended by Robert G. Wilson v, Apr 07 2005

A263674 Double interprimes: a(n) = (q+r)/2 = (p+s)/2 with p

Original entry on oeis.org

9, 12, 15, 18, 30, 42, 60, 81, 102, 105, 108, 120, 144, 165, 186, 195, 228, 260, 270, 312, 363, 381, 399, 420, 426, 441, 462, 489, 495, 552, 570, 582, 600, 696, 705, 714, 765, 816, 825, 858, 870, 882, 897, 924, 987, 1026, 1050, 1056, 1092, 1113, 1167, 1230
Offset: 1

Views

Author

Antonio Roldán, Oct 23 2015

Keywords

Comments

Values of p (lesser of consecutive primes) are in the sequence A022885.

Examples

			600 is in this sequence because 593, 599, 601 and 607 are consecutive primes, and 600 = (599+601)/2 = (593+607)/2.
		

Crossrefs

Programs

  • Mathematica
    (Prime@ # + Prime[# + 3])/2 & /@ Select[Range@ 240, (First@ # + Last@ #)/2 == (#[[2]] + #[[3]])/2 &@ Prime@ Range[#, # + 3] &] (* Michael De Vlieger, Nov 18 2015 *)
    Mean/@Select[Partition[Prime[Range[300]],4,1],(#[[2]]+#[[3]])/2==(#[[1]]+#[[4]])/2&] (* Harvey P. Dale, Aug 18 2024 *)
  • PARI
    {forprime(q=3,2000,p=precprime(q-1); r=nextprime(q+1); s=nextprime(r+1);m=(q+r)/2;if(m==(p+s)/2,print1(m,", ")))}

A260179 Primes pr(k) such that pr(k)+pr(k+1)+pr(k+6)+pr(k+7) = pr(k+2)+pr(k+3)+pr(k+4)+pr(k+5).

Original entry on oeis.org

17, 23, 71, 149, 173, 233, 331, 359, 389, 419, 431, 503, 677, 727, 839, 853, 937, 971, 1019, 1201, 1229, 1277, 1327, 2213, 2221, 2237, 2593, 2689, 2797, 2999, 3019, 3167, 3221, 3253, 3821, 3823, 4027, 4111, 4201, 4219, 4231, 4801, 5147, 5309, 5407, 5437
Offset: 1

Views

Author

Harvey P. Dale, Jul 17 2015

Keywords

Examples

			Starting from 71, the eight consecutive primes are 71, 73, 79, 83, 89, 97, 101, 103; and they satisfy 71+73+101+103=79+83+89+97, so 71 is in the sequence.
		

Crossrefs

Cf. A022885.

Programs

  • Maple
    n := 1 ;
    Lp := [[0,1,6,7],[2,3,4,5]] ;
    for i from 1 do
        if add(ithprime(i+j),j=op(1,Lp)) = add(ithprime(i+j),j=op(2,Lp)) then
            printf("%d %d\n",n,ithprime(i)) ;
            n := n+1 ;
        end if;
    end do: # R. J. Mathar, Aug 06 2015
  • Mathematica
    pr8Q[lst_]:=With[{tadr=TakeDrop[lst,{3,6}]},Total[tadr[[1]]] == Total[ tadr[[2]]]]; Transpose[Select[Partition[Prime[ Range[ 1000]],8,1], pr8Q]][[1]] (* The program uses the TakeDrop function from Mathematica version 10.2 *)

A261470 a(n) = prime(n+3) - prime(n+2) - prime(n+1) + prime(n).

Original entry on oeis.org

1, 2, 0, 0, 0, 0, 4, -2, 0, 2, -4, 0, 4, 2, -4, 0, 2, -4, 2, 2, 0, 4, -2, -6, 0, 0, 0, 12, 0, -8, -2, 4, 0, -4, 4, -2, 0, 2, -4, 4, 0, -6, 0, 8, 10, -8, -10, 0, 4, -2, 4, 4, -4, 0, -4, 0, 2, -4, 6, 12, -6, -12, 0, 12, 2, -4, -4, -6, 4, 4, 0, -2, -2, 0, 4, -2, 0
Offset: 1

Views

Author

Altug Alkan, Aug 20 2015

Keywords

Examples

			a(5) = 19 - 17 - 13 + 11 = 0.
		

Crossrefs

Programs

  • Haskell
    a261470 n = a261470_list !! (n-1)
    a261470_list = zipWith (-) (drop 2 a001223_list) a001223_list
    -- Reinhard Zumkeller, Aug 22 2015
  • Mathematica
    Table[Prime[i+3] - Prime[i+2] - Prime[i+1] + Prime[i], {i,100}] (* G. C. Greubel, Aug 20 2015 *)
  • PARI
    first(m)=vector(m,i,prime(i+3)+prime(i)-prime(i+1)-prime(i+2)) \\ Anders Hellström, Aug 20 2015
    

Formula

a(n) = A001223(n+2) - A001223(n). - Reinhard Zumkeller, Aug 22 2015

A064102 Primes p = prime(k) such that prime(k) + prime(k+7) = prime(k+1) + prime(k+6) = prime(k+2) + prime(k+5) = prime(k+3) + prime(k+4).

Original entry on oeis.org

17, 149, 677, 853, 1277, 5437, 6101, 13499, 13921, 19853, 22073, 41863, 49667, 51307, 51797, 55799, 61637, 66337, 83227, 91121, 100957, 103963, 109111, 113147, 128747, 136309, 137933, 148157, 158849, 163117, 167249, 179033, 205171, 208927
Offset: 1

Views

Author

Robert G. Wilson v, Sep 17 2001

Keywords

Examples

			17 + 43 = 19 + 41 = 23 + 37 = 29 + 31.
		

Crossrefs

Programs

  • Mathematica
    a = {0, 0, 0, 0, 0, 0, 0, 0}; Do[ a = Delete[ a, 1 ]; a = Append[ a, Prime[ n ] ]; If[ a[ [ 1 ] ] + a[ [ 8 ] ] == a[ [ 2 ] ] + a[ [ 7 ] ] == a[ [ 3 ] ] + a[ [ 6 ] ] == a[ [ 4 ] ] + a[ [ 5 ] ], Print[ a[ [ 1 ] ] ] ], {n, 1, 10^4} ]
    Select[Partition[Prime[Range[20000]],8,1],#[[1]]+#[[8]]==#[[2]]+#[[7]]==#[[3]]+#[[6]]==#[[4]]+#[[5]]&][[;;,1]] (* Harvey P. Dale, Jul 03 2025 *)
  • PARI
    { n=0; default(primelimit, 8300000); for (k=1, 10^9, p1=prime(k) + prime(k + 7); p2=prime(k + 1) + prime(k + 6); p3=prime(k + 2) + prime(k + 5); p4=prime(k + 3) + prime(k + 4); if (p1==p2 && p2==p3 && p3==p4, write("b064102.txt", n++, " ", prime(k)); if (n==400, break)) ) } \\ Harry J. Smith, Sep 07 2009

Formula

Primes p = prime(k) = A000040(k) such that A359440(k+3) >= 3. - Peter Munn, Jan 09 2023

A235743 Primes p(k) such that p(k) + p(k+3) = p(k+1) + p(k+2) + 4.

Original entry on oeis.org

17, 41, 79, 131, 149, 173, 227, 233, 239, 347, 349, 379, 439, 463, 521, 599, 641, 673, 677, 983, 1013, 1091, 1231, 1277, 1427, 1429, 1453, 1487, 1549, 1607, 1811, 1949, 2099, 2203, 2309, 2579, 2609, 2687, 2689, 2833, 2857, 2903, 2909, 2917, 3083, 3167, 3299
Offset: 1

Views

Author

Vladimir Shevelev, Jan 15 2014

Keywords

Comments

If p(k) is in the sequence, then the four consecutive primes p(k), p(k+1), p(k+2), p(k+3) possess a property of quadruplet of consecutive squares: n^2 + (n+3)^2 = (n+1)^2 + (n+2)^2 + 4.
Cf. A022885, where such quadruplets possess a linear property: n + (n+3) = (n+1) + (n+2).

Examples

			17 is in the sequence since 17, 19, 23, and 29 are four consecutive primes and it holds 17 + 29 = 19 + 23 + 4.
		

Crossrefs

Cf. A022885.

Programs

  • Mathematica
    f[{a_,b_,c_,d_}]:= a-b-c+d; First /@ Select[Partition[Prime@ Range@ 500, 4, 1], f@# == 4 &] (* Giovanni Resta, Jan 16 2014 *)
    Transpose[Select[Partition[Prime[Range[5000]], 4, 1], First[#] + Last[#]==#[[2]] + #[[3]] + 4&]][[1]] (* Vincenzo Librandi, Feb 02 2014 *)
  • PARI
    isok(p) = { my(k = primepi(p)); (p == prime(k)) && ((prime(k) + prime(k+3)) == (prime(k+1) + prime(k+2) + 4));} \\ Michel Marcus, Jan 15 2014

Extensions

More terms from Michel Marcus, Jan 15 2014

A260265 Numbers n such that prime(n) + prime(n+4) + prime(n+5) + prime(n+7) + prime(n+8) = prime(n+1) + prime(n+2) + prime(n+3) + prime(n+6) + prime(n+9).

Original entry on oeis.org

180, 205, 223, 258, 297, 326, 350, 424, 502, 514, 521, 548, 666, 757, 765, 796, 804, 861, 909, 1006, 1098, 1150, 1264, 1317, 1348, 1349, 1400, 1416, 1592, 1613, 1663, 1757, 1821, 1914, 1939, 2034, 2048, 2073, 2085, 2109, 2164, 2276, 2316, 2360, 2380, 2398, 2655
Offset: 1

Views

Author

K. D. Bajpai, Jul 21 2015

Keywords

Examples

			180 is in the list because 1069 + 1097 + 1103 + 1117 + 1123 = 1087 + 1091 + 1093 + 1109 + 1129.
		

Crossrefs

Programs

  • Magma
    [n: n in [1..3000] | NthPrime(n) + NthPrime(n+4)+ NthPrime(n+5)+ NthPrime(n+7)+ NthPrime(n+8) eq NthPrime(n+1)+ NthPrime(n+2)+ NthPrime(n+3)+ NthPrime(n+6)+ NthPrime(n+9)];
  • Mathematica
    Select[Range[5000], Prime[#] + Prime[# + 4] + Prime[# + 5] + Prime[# + 7] + Prime[# + 8] == Prime[# + 1] + Prime[# + 2] + Prime[# + 3] + Prime[# + 6] + Prime[# + 9] &]
  • PARI
    for(n=1,5000, if(prime(n) + prime(n+4) + prime(n+5) + prime(n+7) + prime(n+8)  == prime(n+1) + prime(n+2) + prime(n+3) + prime(n+6) + prime(n+9), print1(n,", ")));
    
Showing 1-10 of 15 results. Next