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 11-20 of 22 results. Next

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[[#]]]&]

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

A293395 The initial member of 5 consecutive primes whose arithmetic mean is the middle member.

Original entry on oeis.org

71, 271, 337, 431, 631, 661, 769, 1153, 1721, 1789, 2131, 2339, 2381, 2749, 2777, 3313, 3319, 3517, 3919, 4139, 4337, 4729, 4789, 4903, 4937, 4993, 5171, 5303, 5323, 5507, 5849, 5851, 6271, 6323, 6451, 6959, 6983, 7489, 7919, 8221, 8363, 8419, 9349, 9613, 9619
Offset: 1

Views

Author

K. D. Bajpai, Oct 08 2017

Keywords

Comments

3313 is the smallest term such that 3313 +- 6 are both prime.

Examples

			71 is a term because it is the initial member of 5 consecutive primes {71, 73, 79, 83, 89} and (71 + 73 + 79 + 83 + 89)/5 = 79.
271 is a term because it is the initial member of 5 consecutive primes {271, 277, 281, 283, 293} and (271 + 277 + 281 + 283 + 293)/5 = 281.
		

Crossrefs

Programs

  • Maple
    A293395:= proc(n)local a, b, c, d, e; a:=ithprime(n); b:=ithprime(n+1); c:=ithprime(n+2); d:=ithprime(n+3); e:=ithprime(n+4); if (a + b + d + e)/4 = c then RETURN (a); fi; end: seq(A293395(n), n=1..3000);
  • Mathematica
    Select[Prime@ Range[1200], #[[3]] == Mean@ Delete[#, 3] &@ NestList[NextPrime, #, 4] &] (* Michael De Vlieger, Oct 09 2017 *)
    Select[Partition[Prime[Range[1200]],5,1],Mean[#]==#[[3]]&][[;;,1]] (* Harvey P. Dale, Jul 31 2025 *)
  • PARI
    for(n=1, 1000, a=prime(n); b=prime(n+1); c=prime(n+2); d=prime(n+3); e=prime(n+4); if((a+b+d+e)/4==c, print1(a,", ")));
    
  • PARI
    list(lim)=my(v=List(),p=2,q=3,r=5,s=7); forprime(t=11,lim, if(p+q+s+t==4*r, listput(v,p)); p=q; q=r; r=s; s=t); Vec(v) \\ Charles R Greathouse IV, Oct 09 2017

Extensions

Definiyion simplified by David A. Corneth, Oct 14 2017
Examples clarified by Harvey P. Dale, Jul 31 2025

A063535 Primes prime(n) such that prime(n+1)^2 < prime(n)*prime(n+2).

Original entry on oeis.org

2, 5, 11, 17, 19, 29, 41, 43, 59, 71, 79, 83, 101, 107, 109, 127, 137, 149, 163, 179, 191, 197, 227, 229, 239, 269, 281, 283, 311, 313, 331, 347, 349, 353, 379, 383, 397, 401, 419, 431, 439, 443, 461, 463, 487, 499, 503, 521, 541, 569, 571, 599, 617, 641, 643
Offset: 0

Views

Author

Michel ten Voorde, Aug 02 2001

Keywords

Comments

Conjecture: these are the primes such that prime(n+2) - 2*prime(n+1) + prime(n) > 0. If so, this sequence with A122535 and A147812 partition the primes. - Clark Kimberling, May 16 2015

Examples

			a(2) = 5 because 7*7 < 5*11.
		

Crossrefs

Programs

  • Maple
    N:= 1000: # to get all entries where prime(n+2) <= N
    Primes:= select(isprime,[2,seq(2*i+1,i=1..floor((N-1)/2))]):
    J:= select(j -> Primes[j+1]^2Robert Israel, Jun 23 2015
  • PARI
    j=[]; for(n=1,400, if(prime(n+1)^2<(prime(n)*prime(n+2)),j=concat(j, prime(n)))); j
    
  • PARI
    { n=-1; for (m=1, 10^9, if (prime(m + 1)^2 < prime(m)*prime(m + 2), write("b063535.txt", n++, " ", prime(m)); if (n==1000, break)) ) } \\ Harry J. Smith, Aug 25 2009

Extensions

More terms from Jason Earls, Aug 03 2001

A378620 Lesser prime index of twin primes with nonsquarefree mean.

Original entry on oeis.org

2, 5, 7, 17, 20, 28, 35, 41, 43, 45, 49, 52, 57, 64, 69, 81, 83, 98, 109, 120, 140, 144, 152, 171, 173, 176, 178, 182, 190, 206, 215, 225, 230, 236, 253, 256, 262, 277, 286, 294, 296, 302, 307, 315, 318, 323, 336, 346, 373, 377, 390, 395, 405, 428, 430, 444
Offset: 1

Views

Author

Gus Wiseman, Dec 10 2024

Keywords

Comments

A prime index of n is a number m such that prime(m) divides n. The multiset of prime indices of n is row n of A112798.
This is a subset of A029707 (twin prime indices). The other twin primes are A068361, so A029707 is the disjoint union of A068361 and A378620.

Crossrefs

The lesser of twin primes is A001359, index A029707 (complement A049579).
The greater of twin primes is A006512, index A107770 (complement appears to be A168543).
A subset of A029707 (twin prime lesser indices).
Prime indices of the primes listed by A061368.
Indices of twin primes with squarefree mean are A068361.
A000040 lists the primes, differences A001223, (run-lengths A333254, A373821).
A005117 lists the squarefree numbers, differences A076259.
A006562 finds balanced primes.
A013929 lists the nonsquarefree numbers, differences A078147.
A014574 is the intersection of A006093 and A008864.
A038664 finds the first position of a prime gap of 2n.
A046933 counts composite numbers between primes.
A120327 gives the least nonsquarefree number >= n.

Programs

  • Mathematica
    Select[Range[100],Prime[#]+2==Prime[#+1]&&!SquareFreeQ[Prime[#]+1]&]
    PrimePi/@Select[Partition[Prime[Range[500]],2,1],#[[2]]-#[[1]]==2&&!SquareFreeQ[Mean[#]]&][[;;,1]] (* Harvey P. Dale, Jul 13 2025 *)

Formula

prime(a(n)) = A061368(n).

A131695 a(n) = 0 iff 2*prime(n+1) = prime(n) + prime(n+2), otherwise a(n) = 1.

Original entry on oeis.org

1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1
Offset: 1

Views

Author

Giovanni Teofilatto, Sep 15 2007

Keywords

Crossrefs

Cf. A001223, A122535, A064113 (positions of zeros).

Programs

  • Mathematica
    Table[Boole[2 Prime[n + 1] != Prime@ n + Prime[n + 2]], {n, 120}] (* Michael De Vlieger, Dec 17 2016 *)
  • PARI
    A131695(n) = ((2*prime(1+n)) != (prime(n)+prime(2+n))); \\ Antti Karttunen, Aug 30 2017

Formula

a(n) = A098726(n) - 2. - Filip Zaludek, Dec 16 2016

Extensions

Definition and values corrected, keyword:cons removed; R. J. Mathar, Apr 22 2010

A280201 Let the smallest of three successive primes p, p+d, p+2d be a so-called d-triple and b(n) the sequence of d-triples with d<>6. Then a(n) is the number of 6-triples between b(n) and b(n+1).

Original entry on oeis.org

3, 15, 13, 3, 19, 5, 4, 0, 1, 8, 8, 13, 0, 4, 2, 2, 1, 5, 0, 2, 0, 1, 0, 1, 0, 1, 1, 4, 5, 1, 1, 8, 3, 1, 1, 3, 3, 2, 4, 2, 2, 2, 0, 1, 2, 5, 1, 1, 2, 2
Offset: 1

Views

Author

Gerhard Kirchner, Dec 28 2016

Keywords

Comments

The sequence of all d-triples A122535(n) = (3), 47, 151, 167, (199), 251, 257, 367, 557, 587, 601, 647, 727, 941, 971, 1097, 1117, 1181, 1217, 1361, (1499), ... is the union of A047948(n) with 6-triples and b(n) with terms in brackets. There are three 6-triples between 3 and 199 and 15 6-triples between 199 and 1499. Thus a(1)=3 (see example) and a(2)=15.
The average of the first 10 terms is (3+15+13+3+19+5+4+0+1+8)/10 = 7.1. This means that, in this section, the 6-triples are more than 7 times as frequent as the other d-triples as a whole. Let us compare longer sections of a(n) with different magnitudes of n, for example (with S(n)=sum(a(k),k,1,n)/n): n <= 10000 100000 733158
S(n) = 1.28 0.98 0.81
n=733158 was the largest available index when I analyzed a pool of primes <=10^9.
Result: For small n, 6-triples are more frequent than the whole of other d-triples; for large n, the reverse is true. Does S(n) tend to zero? It seems so, see link "Tendency of a(n)". - Gerhard Kirchner, Dec 28 2016

Examples

			The first d-triples are 3 (,5,7, d=2); 47 (,53,59, d=6); 151 (,157,163, d=6); 167 (,173,179, d=6); 199 (,211,223, d=12). So there are three 6-triples between the 2-triple and the 12-triple: a(1)=3.
		

Crossrefs

A371260 a(n) is the first of three consecutive Harshad numbers in arithmetic progression.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 21, 24, 42, 110, 114, 120, 162, 192, 201, 220, 320, 330, 342, 372, 510, 511, 522, 552, 700, 774, 912, 954, 960, 1010, 1014, 1015, 1020, 1050, 1088, 1092, 1101, 1104, 1122, 1242, 1270, 1300, 1410, 1422, 1458, 1526, 1584, 1590, 1602, 1632
Offset: 1

Views

Author

John Bibby, Mar 16 2024

Keywords

Examples

			The three consecutive Harshad numbers starting at 8 (8, 9, 10) are in arithmetic progression.
The same is true of the three consecutive Harshad numbers starting at 21 (21, 24, 27).
		

Crossrefs

Cf. A005349, A122535, A154701 (subsequence).

Programs

  • Mathematica
    Select[Partition[Select[Range[2000], Divisible[#, DigitSum[#]] &], 3, 1], Equal @@ Differences[#] &][[;;, 1]] (* Amiram Eldar, Mar 17 2024 *)
  • Python
    from itertools import count, islice
    def agen(): # generator of terms
        h1, h2, h3 = 1, 2, 3
        while True:
            if h3 - h2 == h2 - h1: yield h1
            h1, h2, h3 = h2, h3, next(k for k in count(h3+1) if k%sum(map(int, str(k))) == 0)
    print(list(islice(agen(), 52))) # Michael S. Branicky, Mar 16 2024

A180441 First term of four consecutive primes whose average is a prime.

Original entry on oeis.org

113, 131, 139, 173, 233, 421, 953, 1013, 1021, 1051, 1583, 1747, 1901, 2099, 2423, 2579, 2819, 2939, 3761, 3779, 3931, 4211, 4253, 4451, 4591, 5003, 5861, 5903, 6427, 6691, 6949, 7079, 7481, 7541, 7717, 8263, 8783, 8831, 9127, 9227, 9413, 9923, 10061
Offset: 1

Views

Author

Carmine Suriano, Sep 05 2010

Keywords

Examples

			a(5)=233 since (233+239+241+251)/4=964/4=241 is a prime.
		

Crossrefs

Formula

a(n)=[p(n)+p(n+1)+p(n+2)+p(n+3)]/4 a(n) being a prime

A293682 a(n) = least odd number k > 1 such that p = prime(n) is the middle of k consecutive primes which have arithmetic mean p, or 1 if no such k exists.

Original entry on oeis.org

1, 1, 3, 1, 1, 1, 7, 1, 1, 15, 1, 17, 1, 1, 1, 3, 1, 1, 1, 13, 1, 5, 1, 11, 1, 1, 1, 1, 1, 1, 1, 1, 37, 1, 51, 17, 3, 1, 1, 3, 33, 1, 1, 7, 1, 1, 3, 1, 67, 7, 1, 1, 1, 1, 3, 3, 1, 1, 1, 5, 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 23, 37, 1, 3, 1, 35, 1, 13, 1, 13, 99, 11, 1
Offset: 1

Views

Author

David A. Corneth, Oct 14 2017

Keywords

Examples

			There are no primes before prime(1) so a(1) = 1.
a(3) = 3 as prime(3) = 5, which is the arithmetic mean of the three consecutive primes {3, 5, 7}.
		

Crossrefs

Programs

  • PARI
    a(n) = {my(s = pprev = pnxt = p = prime(n), q=1); for(i=1, n-1, pprev = precprime(pprev - 1); pnxt = nextprime(pnxt + 1); s += (pprev + pnxt); q += 2; if(p * q == s, return(q))); return(1)}
Previous Showing 11-20 of 22 results. Next