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.

Previous Showing 61-70 of 150 results. Next

A337489 a(n) is the k-th prime, such that abs(prime(k) - Sum_{j=k-1..k+1} prime(j)/3) sets a new record.

Original entry on oeis.org

3, 7, 29, 113, 523, 1151, 1327, 9551, 15683, 19609, 25471, 31397, 156007, 360653, 370261, 492113, 1349533, 1357201, 1357333, 1562051, 2010733, 4652507, 17051707, 17051887, 20831323, 47326693, 47326913, 122164747, 189695893, 191912783, 387096133, 428045741, 436273291
Offset: 1

Views

Author

Hugo Pfoertner, Aug 29 2020

Keywords

Comments

A337488 are the corresponding values of k.

Examples

			List of first terms:
   a(n) pi(a(n))  average-median
     3,      2,   1/3  = (2 + 3 + 5)/3 - 3
     7,      4,   2/3  = (5 + 7 + 11)/3 - 7
    29,     10,  -4/3  = (23 + 29 + 31)/3 - 29
   113,     30,  10/3
   523,     99,  16/3
  1151,    190, -20/3
  1327,    217,  28/3
  9551,   1183,  32/3
		

Crossrefs

Programs

  • PARI
    a337489(limp) = {my(p1=0, p2=2, p3=3, s=p1+p2+p3, d=0); forprime(p=5, limp, s=s-p1+p; my(dd=abs(s/3-p3)); if(dd>d, print1(p3, ", "); d=dd); p1=p2; p2=p3; p3=p)};
    a337489(500000000)

Extensions

Name edited by Peter Munn, Aug 01 2025

A373824 Sorted positions of first appearances in the run-lengths (differing by 0) of the run-lengths (differing by 2) of the odd primes.

Original entry on oeis.org

1, 2, 11, 13, 29, 33, 45, 51, 57, 59, 69, 75, 105, 129, 211, 227, 301, 313, 321, 341, 407, 413, 447, 459, 537, 679, 709, 767, 1113, 1301, 1405, 1411, 1429, 1439, 1709, 1829, 1923, 2491, 2543, 2791, 2865, 3301, 3471, 3641, 4199, 4611, 5181, 5231, 6345, 6555
Offset: 1

Views

Author

Gus Wiseman, Jun 21 2024

Keywords

Comments

Sorted positions of first appearances in A373819.

Examples

			The runs of odd primes differing by 2 begin:
   3   5   7
  11  13
  17  19
  23
  29  31
  37
  41  43
  47
  53
  59  61
  67
  71  73
  79
with lengths:
3, 2, 2, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 1, 1, 1, 2, 2, 1, 1, 1, 2, 2, 1, 1, 1, 1, 2, 2, 2, ...
which have runs beginning:
  3
  2 2
  1
  2
  1
  2
  1 1
  2
  1
  2
  1 1 1 1
  2 2
  1 1 1
with lengths:
1, 2, 1, 1, 1, 1, 2, 1, 1, 1, 4, 2, 3, 2, 4, 3,...
with sorted positions of first appearances a(n).
		

Crossrefs

Sorted firsts of A373819 (run-lengths of A251092).
The unsorted version is A373825.
For antiruns we have A373826, unsorted A373827.
A000040 lists the primes.
A001223 gives differences of consecutive primes (firsts A073051), run-lengths A333254 (firsts A335406), run-lengths of run-lengths A373821.
A046933 counts composite numbers between primes.
A065855 counts composite numbers up to n.
A071148 gives partial sums of odd primes.
A373820 gives run-lengths of antirun-lengths, run-lengths of A027833.
For composite runs: A005381, A054265, A068780, A373403, A373404.

Programs

  • Mathematica
    t=Length/@Split[Length/@Split[Select[Range[3,10000],PrimeQ],#1+2==#2&]];
    Select[Range[Length[t]],FreeQ[Take[t,#-1],t[[#]]]&]

A071680 Primes that are the arithmetic mean of their prime predecessor and another prime.

Original entry on oeis.org

5, 37, 53, 67, 157, 173, 211, 257, 263, 277, 373, 479, 563, 593, 607, 613, 631, 653, 733, 809, 947, 977, 1009, 1103, 1123, 1187, 1223, 1297, 1367, 1471, 1511, 1607, 1663, 1721, 1747, 1753, 1783, 1867, 1901, 1907, 1931, 1993, 2137, 2287, 2377, 2411, 2417
Offset: 1

Views

Author

Reinhard Zumkeller, May 31 2002; revised Jul 16 2003

Keywords

Comments

prime(n) where 2*prime(n) - prime(n-1) is prime. - Robert Israel, Dec 01 2015

Examples

			A000040(12) = 37, A000040(12-1) = 31, 37 = (31 + 43)/2, therefore 37 is a term.
		

Crossrefs

Cf. A071681, A006562 is a subsequence.

Programs

  • Maple
    Primes:= select(isprime, [2,seq(i,i=1..10^4,2)]):
    Primes[select(i -> isprime(2*Primes[i]-Primes[i-1]), [$2..nops(Primes)])]; # Robert Israel, Dec 01 2015
  • Mathematica
    p = q = 2; lst = {}; Do[q = Prime@n; If[PrimeQ[2q - p], AppendTo[lst, q]]; p = q, {n, 2, 400}]; lst (* Robert G. Wilson v, Mar 22 2007 *)
  • PARI
    lista(nn) = {forprime(p=5, nn, if (isprime(2*p-precprime(p-1)), print1(p, ", ")););} \\ Michel Marcus, Dec 01 2015

Extensions

Thanks to Sven Simon for noticing errors in the original version.

A075541 Numbers k such that prime(k) + prime(k+1) + prime(k+2) is a multiple of 3.

Original entry on oeis.org

2, 15, 36, 39, 46, 54, 55, 73, 96, 99, 102, 107, 110, 118, 129, 160, 164, 167, 179, 184, 187, 194, 199, 202, 218, 231, 238, 239, 242, 271, 272, 273, 274, 290, 291, 292, 311, 326, 339, 356, 357, 358, 362, 387, 419, 426, 437, 438, 449, 452, 464, 465, 489, 508
Offset: 1

Views

Author

Zak Seidov, Sep 21 2002

Keywords

Comments

Not every three successive primes have an integer average. The integer averages are in A075540.
Not all of these 3-averages are prime: the prime 3-averages are in A006562 (balanced primes). There are surprisingly many prime 3-averages: among first 117 3-averages, there are 59 primes. Indices i(n) of first prime in sequence of three primes with integer average are in sequence A064113. Interprimes (s-averages with s=2) are all composite, see A024675.

Examples

			a(2) = 15 because (prime(15)+prime(16)+prime(17)) = (1/3)*(47 + 53 + 59) = 53 (integer average of three successive primes).
		

Crossrefs

Programs

  • Maple
    R:= NULL: count:= 0:
    q:= 2: r:= 3:
    for i from 1 while count < 100 do
      p:= q; q:= r; r:= nextprime(r);
      if p+q+r mod 3 = 0 then
         R:= R,i; count:= count+1
      fi
    od:
    R; # Robert Israel, Nov 10 2024
  • Mathematica
    A075541= {}; Do[If[IntegerQ[s3 = (Prime[i] + Prime[i + 1] + Prime[i + 2])/3], A075541 = Append[A075541, i]], {i, 1000}]; (* 119 terms*)

A125565 Primes p=prime(i) of level (1,12), i.e., such that A118534(i)=prime(i-12).

Original entry on oeis.org

15014557, 27001043, 29602093, 50234633, 87028433, 91814759, 94529221, 103336843, 112840309, 113774329, 113961299, 114887657, 115528969, 118974901, 129235273, 144352123, 146127721, 160370491, 163559197, 169274999, 188168059, 188895919, 191829409, 198823447
Offset: 1

Views

Author

Rémi Eismann, Jan 27 2007

Keywords

Comments

This subsequence of A125830 and of A162174 gives primes of level (1,12): If prime(i) has level 1 in A117563 and 2*prime(i) - prime(i+1) = prime(i-k), then we say that prime(i) has level (1,k).

Examples

			prime(5316164) - prime(5316163) = 91814831 - 91814759 = 91814759 - 91814687 = prime(5316163) - prime(5316163-12) and prime(5316163) has level 1 in A117563, so prime(5316163)=91814759 has level (1,12).
		

Crossrefs

Cf. A006562 (primes of level (1,1)), A117078, A117563, A006562, A117876, A118464, A118467, A119402, A119403, A119404.

Extensions

Definition and comment reworded following suggestions from the author. - M. F. Hasler, Nov 30 2009

A125572 Primes p=prime(i) of level (1,13), i.e., such that A118534(i)=prime(i-13).

Original entry on oeis.org

35630467, 118877047, 123823081, 140061577, 155032793, 175204303, 184606997, 188871349, 189489733, 232093339, 244004749, 278518081, 309055367, 310542257, 313596551, 315659909, 329918227, 340761691, 389220347, 398329523, 411405833, 422745641, 480428801, 485608819
Offset: 1

Views

Author

Rémi Eismann and Fabien Sibenaler, Jan 27 2007

Keywords

Comments

This subsequence of A125830 and of A162174 gives primes of level (1,13): If prime(i) has level 1 in A117563 and 2*prime(i) - prime(i+1) = prime(i-k), then we say that prime(i) has level (1,k).

Examples

			prime(10272256) - prime(10272255) = 184607153 - 184606997 = 184606997 - 184606841 = prime(10272255) - prime(10272255-13) and prime(10272255) has level 1 in A117563, so prime(10272255)=184606997 has level (1,13).
		

Crossrefs

Cf. A006562 (primes of level (1,1)), A117078, A117563, A117876, A118464, A118467, A119402, A119403, A119404.

Extensions

Definition and comment reworded following suggestions from the authors. - M. F. Hasler, Nov 30 2009

A125574 Primes p=prime(i) of level (1,14), i.e., such that A118534(i)=prime(i-14).

Original entry on oeis.org

31515413, 69730637, 132102911, 132375259, 215483129, 284491367, 325689253, 388190689, 548369603, 620829113, 633418787, 638213603, 670216277, 793852487, 797759539, 960200149, 1038197399, 1050359137, 1092920249, 1331713301, 1342954871, 1349496367, 1365964199
Offset: 1

Views

Author

Rémi Eismann and Fabien Sibenaler, Jan 27 2007

Keywords

Comments

This subsequence of A125830 and of A162174 gives primes of level (1,14): If prime(i) has level 1 in A117563 and 2*prime(i) - prime(i+1) = prime(i-k), then we say that prime(i) has level (1,k).

Examples

			prime(15456800) - prime(15456799) = 284491601 - 284491367 = 284491367 - 284491133 = prime(15456799) - prime(15456799-14) and prime(15456799) has level 1 in A117563, so prime(15456799) = 284491367 has level (1,14).
		

Crossrefs

Cf. A117078, A117563, A006562 (primes of level (1,1)), A117876, A118464, A118467, A119402, A119403, A119404.

Programs

  • PARI
    lista(nn) = my(c=15, v=primes(15)); forprime(p=53, nn, if(2*v[c]-p==v[c=c%15+1], print1(precprime(p-1), ", ")); v[c]=p); \\ Jinyuan Wang, Jun 18 2021

Extensions

Definition and comment reworded following suggestions from the authors. - M. F. Hasler, Nov 30 2009

A126243 a(n) = smallest prime number p which is the arithmetic mean of n-th prime < p and n-th prime > p.

Original entry on oeis.org

5, 11, 11, 41, 29, 37, 53, 67, 131, 71, 97, 139, 127, 727, 193, 157, 191, 211, 191, 359, 307, 521, 349, 577, 571, 353, 307, 487, 347, 541, 571, 487, 541, 409, 947, 593, 563, 569, 787, 547, 587, 983, 587, 569, 587, 1223, 563, 557, 1213, 569, 563, 1381, 1213
Offset: 1

Views

Author

Artur Jasinski, Dec 21 2006

Keywords

Examples

			5 is the smallest prime p = prime(n) such that p = (prime(n-1)+prime(n+1))/2 (5 = (3+7)/2).
		

Crossrefs

Programs

  • Mathematica
    f[n_] := Block[{k = n + 1, p},While[p = (Prime[k - n] + Prime[k + n])/2; p != Prime[k], k++ ];p];Table[f[n], {n, 58}] (* Ray Chandler, Dec 27 2006 *)

Extensions

Extended by Ray Chandler, Dec 27 2006
Figure and b-file updated by Hans Havermann, Feb 07 2007

A179067 Orders of consecutive clusters of twin primes.

Original entry on oeis.org

1, 3, 1, 1, 1, 1, 2, 2, 3, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 2, 1, 1, 3, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 2, 1, 1, 1, 1, 1, 1, 1
Offset: 1

Views

Author

Franz Vrabec, Jun 27 2010

Keywords

Comments

For k>=1, 2k+4 consecutive primes P1, P2, ..., P2k+4 defining a cluster of twin primes of order k iff P2-P1 <> 2, P4-P3 = P6-P5 = ... = P2k+2 - P2k+1 = 2, P2k+4 - P2k+3 <> 2.
Also the lengths of maximal runs of terms differing by 2 in A029707 (leading index of twin primes), complement A049579. - Gus Wiseman, Dec 05 2024

Examples

			The twin prime cluster ((101,103),(107,109)) of order k=2 stems from the 2k+4 = 8 consecutive primes (89, 97, 101, 103, 107, 109, 113, 127) because 97-89 <> 2, 103-101 = 109-107 = 2, 127-113 <> 2.
From _Gus Wiseman_, Dec 05 2024: (Start)
The leading indices of twin primes are:
  2, 3, 5, 7, 10, 13, 17, 20, 26, 28, 33, 35, 41, 43, 45, 49, 52, ...
with maximal runs of terms differing by 2:
  {2}, {3,5,7}, {10}, {13}, {17}, {20}, {26,28}, {33,35}, {41,43,45}, {49}, {52}, ...
with lengths a(n).
(End)
		

Crossrefs

Cf. A077800.
A000040 lists the primes, differences A001223 (run-lengths A333254, A373821).
A006512 gives the greater of twin primes.
A029707 gives the leading index of twin primes, complement A049579.
A038664 finds the first prime gap of length 2n.
A046933 counts composite numbers between primes.

Programs

  • Maple
    R:= 1: count:= 1: m:= 0:
    q:= 5: state:= 1:
    while count < 100 do
     p:= nextprime(q);
     if state = 1 then
        if p-q = 2 then state:= 2; m:= m+1;
        else
          if m > 0 then R:= R,m; count:= count+1; fi;
          m:= 0
        fi
     else state:= 1;
     fi;
     q:= p
    od:
    R; # Robert Israel, Feb 07 2023
  • Mathematica
    Length/@Split[Select[Range[2,100],Prime[#+1]-Prime[#]==2&],#2==#1+2&] (* Gus Wiseman, Dec 05 2024 *)
  • PARI
    a(n)={my(o,P,L=vector(3));n++;forprime(p=o=3,,L=concat(L[2..3],-o+o=p);L[3]==2||next;L[1]==2&&(P=concat(P,p))&&next;n--||return(#P);P=[p])} \\ M. F. Hasler, May 04 2015

Extensions

More terms from M. F. Hasler, May 04 2015

A213025 Balanced semiprimes (of order one): semiprimes which are the average of the previous semiprime and the following semiprime.

Original entry on oeis.org

34, 86, 94, 122, 142, 185, 194, 202, 214, 218, 262, 289, 302, 314, 321, 358, 371, 394, 407, 413, 415, 422, 446, 471, 489, 493, 497, 517, 535, 562, 581, 586, 626, 634, 669, 687, 698, 734, 785, 791, 815, 838, 842, 922, 982, 989, 1042, 1057, 1079, 1135, 1138
Offset: 1

Views

Author

Gerasimov Sergey, Jun 03 2012

Keywords

Comments

Semiprimes that are the average of three successive semiprimes.
First term not also in A086005 is 185. - Alonso del Arte, Jun 04 2012

Examples

			194 is in the sequence because 194 = (187 + 194 + 201)/3 = (A001358(61) + A001358(62) + A001358(63))/3.
		

Crossrefs

Cf. A086005 (subsequence), A001358, A006562, A065516, A212820.

Programs

  • Haskell
    a213025 n = a213025_list !! (n-1)
    a213025_list = f a001358_list where
       f (x:sps'@(y:z:sps)) | 2 * y == (x + z) = y : f sps'
                            | otherwise        = f sps'
    -- Reinhard Zumkeller, Jun 10 2012
  • Maple
    with(numtheory):
    prevsp:= proc(n) local k; for k from n-1 by -1
               while isprime(k) or bigomega(k)<>2 do od; k end:
    nextsp:= proc(n) local k; for k from n+1
               while isprime(k) or bigomega(k)<>2 do od; k end:
    a:= proc(n) option remember; local s;
          s:= `if`(n=1, 4, a(n-1));
          do s:= nextsp(s);
             if s=(prevsp(s)+nextsp(s))/2 then break fi
          od; s
        end:
    seq (a(n), n=1..100);  # Alois P. Heinz, Jun 03 2012
  • Mathematica
    bspQ[{a_,b_,c_}]:=b==(a+c)/2; With[{sp=Select[Range[1200],PrimeOmega[#] == 2&]}, Transpose[Select[Partition[sp,3,1],bspQ]][[2]]] (* Harvey P. Dale, Nov 18 2012 *)
    Select[Partition[Select[Range[1200],PrimeOmega[#]==2&],3,1],Mean[#]==#[[2]]&][[;;,2]] (* Harvey P. Dale, Jul 31 2025 *)

Formula

2*sp_(n) = sp_(n - 1) + sp_(n + 1).
a(n) = (1/3) * (sp(i) + sp(i + 1) + sp(i + 2)), for some i(n).
Previous Showing 61-70 of 150 results. Next