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 10 results.

A356347 Indices of the primes in A181424.

Original entry on oeis.org

4, 17, 38, 41, 48, 56, 57, 75, 104, 109, 112, 120, 131, 162, 166, 186, 189, 196, 201, 220, 241, 273, 274, 293, 341, 360, 389, 421, 428, 466, 467, 510, 522, 555, 601, 607, 623, 631, 635, 669, 684, 685, 704, 711, 712, 735, 763, 793, 815, 823, 824, 831, 832
Offset: 1

Views

Author

Clark Kimberling, Nov 21 2022

Keywords

Comments

This sequence, together with A358529 and A358531, partition the set of positive integers >= 3.

Examples

			  n     1    2    3    4    5    6   7
  k     4   17   38   41   48   56  57
  p(n)  7   59  163  179  223  263 269
		

Crossrefs

Programs

  • Mathematica
    t = Select[2 + Range[1440],
    Prime[#] - Prime[# - 1] == Prime[# - 1] - Prime[# - 2] &]  (* A356347 *)
    Prime[t]  (* A181424 *)

Formula

a(n) = A064113(n) + 2.

A006562 Balanced primes (of order one): primes which are the average of the previous prime and the following prime.

Original entry on oeis.org

5, 53, 157, 173, 211, 257, 263, 373, 563, 593, 607, 653, 733, 947, 977, 1103, 1123, 1187, 1223, 1367, 1511, 1747, 1753, 1907, 2287, 2417, 2677, 2903, 2963, 3307, 3313, 3637, 3733, 4013, 4409, 4457, 4597, 4657, 4691, 4993, 5107, 5113, 5303, 5387, 5393
Offset: 1

Views

Author

Keywords

Comments

Subsequence of A075540. - Franklin T. Adams-Watters, Jan 11 2006
This subsequence of A125830 and of A162174 gives primes of level (1,1): More generally, the i-th prime p(i) is of level (1,k) if and only if it has level 1 in A117563 and 2 p(i) - p(i+1) = p(i-k). - Rémi Eismann, Feb 15 2007
Note the similarity between plots of A006562 and A013916. - Bill McEachen, Sep 07 2009
Balanced primes U strong primes = good primes. Or, A006562 U A051634 = A046869. - Juri-Stepan Gerasimov, Mar 01 2010
Primes prime(n) such that A001223(n-1) = A001223(n). - Irina Gerasimova, Jul 11 2013
Numbers m such that A346399(m) is odd and >= 3. - Ya-Ping Lu, Dec 26 2021 and May 07 2024
"Balanced" means that the next and preceding gap are of the same size, i.e., the second difference A036263 vanishes; so these are the primes whose indices are 1 more than indices of zeros in A036263, listed in A064113. - M. F. Hasler, Oct 15 2024
Primes which are the average of three consecutive primes. - Peter Schorn, Apr 30 2025

Examples

			5 belongs to the sequence because 5 = (3 + 7)/2. Likewise 53 = (47 + 59)/2.
5 belongs to the sequence because it is a term, but not first or last, of the AP of consecutive primes (3, 5, 7).
53 belongs to the sequence because it is a term, but not first or last, of the AP of consecutive primes (47, 53, 59).
257 and 263 belong to the sequence because they are terms, but not first or last, of the AP of consecutive primes (251, 257, 263, 269).
		

References

  • A. Murthy, Smarandache Notions Journal, Vol. 11 N. 1-2-3 Spring 2000.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • David Wells, The Penguin Dictionary of Curious and Interesting Numbers (Rev. ed. 1997), p. 134.

Crossrefs

Primes A000040 whose indices are 1 more than A064113, indices of zeros in A036263 (second differences of the primes).
Cf. A225494 (multiplicative closure); complement of A178943 with respect to A000040.
Cf. A055380, A051795, A081415, A096710 for other balanced prime sequences.

Programs

  • Haskell
    a006562 n = a006562_list !! (n-1)
    a006562_list = filter ((== 1) . a010051) a075540_list
    -- Reinhard Zumkeller, Jan 20 2012
    
  • Haskell
    a006562 n = a006562_list !! (n-1)
    a006562_list = h a000040_list where
       h (p:qs@(q:r:ps)) = if 2 * q == (p + r) then q : h qs else h qs
    -- Reinhard Zumkeller, May 09 2013
    
  • Magma
    [a: n in [1..1000] | IsPrime(a) where a is NthPrime(n)-NthPrime(n+1)+NthPrime(n+2)]; // Vincenzo Librandi, Jun 23 2016
    
  • Mathematica
    Transpose[ Select[ Partition[ Prime[ Range[1000]], 3, 1], #[[2]] ==(#[[1]] + #[[3]])/2 &]][[2]]
    p=Prime[Range[1000]]; p[[Flatten[1+Position[Differences[p, 2], 0]]]]
    Prime[#]&/@SequencePosition[Differences[Prime[Range[800]]],{x_,x_}][[All,2]] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Jan 31 2019 *)
  • PARI
    betwixtpr(n) = { local(c1,c2,x,y); for(x=2,n, c1=c2=0; for(y=prime(x-1)+1,prime(x)-1, if(!isprime(y),c1++); ); for(y=prime(x)+1,prime(x+1)-1, if(!isprime(y),c2++); ); if(c1==c2,print1(prime(x)",")) ) } \\ Cino Hilliard, Jan 25 2005
    
  • PARI
    forprime(p=1,999, p-precprime(n-1)==nextprime(p+1)-p && print1(p",")) \\ M. F. Hasler, Jun 01 2013
    
  • PARI
    is(n)=n-precprime(n-1)==nextprime(n+1)-n && isprime(n) \\ Charles R Greathouse IV, Apr 07 2016
    
  • Python
    from sympy import nextprime; p, q, r = 2, 3, 5
    while q < 6000:
        if 2*q == p + r: print(q, end = ", ")
        p, q, r = q, r, nextprime(r) # Ya-Ping Lu, Dec 23 2021

Formula

2*p_n = p_(n-1) + p_(n+1).
Equals { p = prime(k) | A118534(k) = prime(k-1) }. - Rémi Eismann, Nov 30 2009
a(n) = A000040(A064113(n) + 1) = (A122535(n) + A181424(n)) / 2. - Reinhard Zumkeller, Jan 20 2012
a(n) = A122535(n) + A117217(n). - Zak Seidov, Feb 14 2013
Equals A145025 intersect A000040 = A145025 \ A024675. - M. F. Hasler, Jun 01 2013
Conjecture: Limit_{n->oo} n*(log(a(n)))^2 / a(n) = 1/2. - Alain Rocchelli, Mar 21 2024
Conjecture: The asymptotic limit of the average of a(n+1)-a(n) is equivalent to 2*(log(a(n)))^2. Otherwise formulated: 2 * Sum_{n=1..N} (log(a(n)))^2 ~ a(N). - Alain Rocchelli, Mar 23 2024

Extensions

Reworded comment and added formula from R. Eismann. - M. F. Hasler, Nov 30 2009
Edited by Daniel Forgues, Jan 15 2011

A064113 Indices k such that (1/3)*(prime(k)+prime(k+1)+prime(k+2)) is a prime.

Original entry on oeis.org

2, 15, 36, 39, 46, 54, 55, 73, 102, 107, 110, 118, 129, 160, 164, 184, 187, 194, 199, 218, 239, 271, 272, 291, 339, 358, 387, 419, 426, 464, 465, 508, 520, 553, 599, 605, 621, 629, 633, 667, 682, 683, 702, 709, 710, 733, 761, 791, 813, 821, 822, 829, 830
Offset: 1

Views

Author

Jason Earls, Sep 08 2001

Keywords

Comments

n such that d(n) = d(n+1), where d(n) = prime(n+1) - prime(n) = A001223(n).
Of interest because when I generalize it to d(n) = d(n+2), d(n) = d(n+3), etc. I am unable to find any positive number k such that d(n) = d(n+k) has no solution.
From Lei Zhou, Dec 06 2005: (Start)
When (1/3)*(prime(k) + prime(k+1) + prime(k+2)) is prime, then it is equal to prime(k+1).
Also, indices k such that (prime(k)+prime(k+2))/2 = prime(k+1).
The Mathematica program is based on the alternative definition. (End)
Inflection and undulation points of the primes, i.e., positions of zeros in A036263, the second differences of the primes. - Gus Wiseman, Mar 24 2020

Examples

			a(2) = 15 because (p(15)+p(16)+p(17)) = 1/3(47 + 53 + 59) = 53 (prime average of three successive primes).
Splitting the prime gaps into anti-runs gives: (1,2), (2,4,2,4,2,4,6,2,6,4,2,4,6), (6,2,6,4,2,6,4,6,8,4,2,4,2,4,14,4,6,2,10,2,6), (6,4,6), ... Then a(n) is the n-th partial sum of the lengths of these anti-runs. - _Gus Wiseman_, Mar 24 2020
		

Crossrefs

Indices of zeros in A036263 (second differences of primes).
Indices (A000720 = primepi) of balanced primes A006562, minus 1.
Cf. A262138.
Complement of A333214.
First differences are A333216.
The version for strict ascents is A258025.
The version for strict descents is A258026.
The version for weak ascents is A333230.
The version for weak descents is A333231.
A triangle for anti-runs of compositions is A106356.
Lengths of maximal runs of prime gaps are A333254.
Anti-runs of compositions in standard order are A333381.

Programs

  • Haskell
    import Data.List (elemIndices)
    a064113 n = a064113_list !! (n-1)
    a064113_list = map (+ 1) $ elemIndices 0 a036263_list
    -- Reinhard Zumkeller, Jan 20 2012
    
  • Mathematica
    ct = 0; Do[If[(Prime[k] + Prime[k + 2] - 2*Prime[k + 1]) == 0, ct++; n[ct] = k], {k, 1, 2000}]; Table[n[k], {k, 1, ct}] (* Lei Zhou, Dec 06 2005 *)
    Join@@Position[Differences[Array[Prime,100],2],0] (* Gus Wiseman, Mar 24 2020 *)
  • PARI
    d(n) = prime(n+1)-prime(n); j=[]; for(n=1,1500, if(d(n)==d(n+1), j=concat(j,n))); j
    
  • PARI
    { n=0; for (m=1, 10^9, if (d(m)==d(m+1), write("b064113.txt", n++, " ", m); if (n==1000, break)) ) } \\ Using d(n) above. - Harry J. Smith, Sep 07 2009
    
  • PARI
    [n | n<-[1..888], !A036263(n)] \\ M. F. Hasler, Oct 15 2024
    
  • PARI
    \\ More efficient for larges range of n:
    A064113_upto(N, n=1, L=List(), q=prime(n+1), d=q-prime(n))={forprime(p=1+q,, if(d==d=p-q, listput(L,n); #LM. F. Hasler, Oct 15 2024
    
  • Python
    from itertools import count, islice
    from sympy import prime, nextprime
    def A064113_gen(startvalue=1): # generator of terms >= startvalue
        c = max(startvalue,1)
        p = prime(c)
        q = nextprime(p)
        r = nextprime(q)
        for k in count(c):
            if p+r==(q<<1):
                yield k
            p, q, r = q, r, nextprime(r)
    A064113_list = list(islice(A064113_gen(),20)) # Chai Wah Wu, Feb 27 2024

Formula

A036263(a(n)) = 0; A122535(n) = A000040(a(n)); A006562(n) = A000040(a(n) + 1); A181424(n) = A000040(a(n) + 2). - Reinhard Zumkeller, Jan 20 2012
A262138(2*a(n)) = 0. - Reinhard Zumkeller, Sep 12 2015
a(n) = A000720(A006562(n)) - 1, where A000720 = (prime)pi, A006562 = balanced primes. - M. F. Hasler, Oct 15 2024

A122535 Smallest prime of a triple of successive primes, where the middle one is the arithmetic mean of the other two.

Original entry on oeis.org

3, 47, 151, 167, 199, 251, 257, 367, 557, 587, 601, 647, 727, 941, 971, 1097, 1117, 1181, 1217, 1361, 1499, 1741, 1747, 1901, 2281, 2411, 2671, 2897, 2957, 3301, 3307, 3631, 3727, 4007, 4397, 4451, 4591, 4651, 4679, 4987, 5101, 5107, 5297, 5381, 5387
Offset: 1

Views

Author

Miklos Kristof, Sep 18 2006

Keywords

Comments

Subsets are A047948, A052188, A052189, A052190, A052195, A052197, A052198, etc. - R. J. Mathar, Apr 11 2008
Could be generated by searching for cases A001223(i) = A001223(i+1), writing down A000040(i). - R. J. Mathar, Dec 20 2008
a(n) = A006562(n) - A117217(n). - Zak Seidov, Feb 12 2013
These are primes for which the subsequent prime gaps are equal, so (p(k+2)-p(k+1))/(p(k+1)-p(k)) = 1. It is conjectured that prime gaps ratios equal to one are less frequent than those equal to 1/2, 2, 3/2, 2/3, 1/3 and 3. - Andres Cicuttin, Nov 07 2016

Examples

			The prime 7 is not in the list, because in the triple (7, 11, 13) of successive primes, 11 is not equal (7 + 13)/2 = 10.
The second term, 47, is the first prime in the triple (47, 53, 59) of primes, where 53 is the mean of 47 and 59.
		

Crossrefs

Programs

  • Haskell
    a122535 = a000040 . a064113  -- Reinhard Zumkeller, Jan 20 2012
    
  • Mathematica
    Clear[d2, d1, k]; d2[n_] = Prime[n + 2] - 2*Prime[n + 1] + Prime[n]; d1[n_] = Prime[n + 1] - Prime[n]; k[n_] = -d2[n]/(1 + d1[n])^(3/2); Flatten[Table[If[k[n] == 0, Prime[n], {}], {n, 1, 1000}]] (* Roger L. Bagula, Nov 13 2008 *)
    Transpose[Select[Partition[Prime[Range[750]], 3, 1], #[[2]] == (#[[1]] + #[[3]])/2 &]][[1]]  (* Harvey P. Dale, Jan 09 2011 *)
  • PARI
    A122535()={n=3;ctr=0;while(ctr<50, avgg=( prime(n-2)+prime(n) )/2;
    if( prime(n-1) ==avgg, ctr+=1;print( ctr,"  ",prime(n-2) )  );n+=1); } \\ Bill McEachen, Jan 19 2015

Formula

{A000040(i): A000040(i+1)= (A000040(i)+A000040(i+2))/2 }. - R. J. Mathar, Dec 20 2008
a(n) = A000040(A064113(n)). - Reinhard Zumkeller, Jan 20 2012

Extensions

More terms from Roger L. Bagula, Nov 13 2008
Definition rephrased by R. J. Mathar, Dec 20 2008

A054803 Fourth term of balanced prime quartets: p(m-2)-p(m-3) = p(m-1)-p(m-2) = p(m)-p(m-1).

Original entry on oeis.org

269, 1759, 3319, 5119, 5399, 6329, 6379, 12659, 13469, 14759, 15809, 15919, 17489, 18229, 19489, 23339, 26189, 30109, 30649, 53629, 56099, 62219, 63709, 71359, 74507, 75539, 76597, 77569, 78809, 80929, 82799, 83449, 84449, 89119, 89399
Offset: 1

Views

Author

Henry Bottomley, Apr 10 2000

Keywords

Crossrefs

Programs

  • Mathematica
    Transpose[Select[Partition[Prime[Range[9000]],4,1],Length[Union[ Differences[ #]]]==1&]][[4]] (* Harvey P. Dale, Aug 27 2012 *)

A358528 a(n) = n-th prime p(k) such that p(k) - p(k-1) > p(k-1) - p(k-2).

Original entry on oeis.org

5, 11, 17, 23, 29, 37, 47, 53, 67, 79, 89, 97, 107, 113, 127, 137, 149, 157, 173, 191, 197, 211, 233, 239, 251, 277, 293, 307, 317, 331, 347, 353, 359, 367, 389, 397, 409, 419, 431, 439, 449, 457, 467, 479, 499, 509, 521, 541, 557, 577, 587, 607, 631, 647
Offset: 1

Views

Author

Clark Kimberling, Nov 21 2022

Keywords

Comments

This sequence, together with A358530 and A181424, partition the set of primes >= 5. The corresponding sequences of indices, A358529, A358531, and A356347, partition the set of positive integers >= 3.

Examples

			   n      1   2   3   4   5   6   7
   k      3   5   7   9  10  12  15
   p(n)   5  11  17  23  29  37  47
		

Crossrefs

Programs

  • Mathematica
    t = Select[2 + Range[140],
    Prime[#] - Prime[# - 1] > Prime[# - 1] - Prime[# - 2] &]  (* A358529 *)
    Prime[t]  (* A358528 *)

A358529 Indices of the primes in A358528.

Original entry on oeis.org

3, 5, 7, 9, 10, 12, 15, 16, 19, 22, 24, 25, 28, 30, 31, 33, 35, 37, 40, 43, 45, 47, 51, 52, 54, 59, 62, 63, 66, 67, 69, 71, 72, 73, 77, 78, 80, 81, 83, 85, 87, 88, 91, 92, 95, 97, 98, 100, 102, 106, 107, 111, 115, 118, 119, 122, 124, 125, 126, 128, 133, 136
Offset: 1

Views

Author

Clark Kimberling, Nov 21 2022

Keywords

Comments

This sequence, together with A358531 and A356347, partition the set of positive integers >= 3.

Examples

			  n      1   2   3   4   5   6   7
  k      3   5   7   9  10  12  15
  p(n)   5  11  17  23  29  37  47
		

Crossrefs

Programs

  • Mathematica
    t = Select[2 + Range[140],
    Prime[#] - Prime[# - 1] > Prime[# - 1] - Prime[# - 2] &]  (* A358529 *)
    Prime[t]  (* A358528 *)

Formula

a(n) = A233671(n) + 1.

A358530 a(n) = n-th prime prime(k) such that prime(k) - prime(k-1) < prime(k-1) - prime(k-2).

Original entry on oeis.org

13, 19, 31, 41, 43, 61, 71, 73, 83, 101, 103, 109, 131, 139, 151, 167, 181, 193, 199, 227, 229, 241, 257, 271, 281, 283, 311, 313, 337, 349, 373, 383, 401, 421, 433, 443, 461, 463, 487, 491, 503, 523, 547, 563, 571, 593, 601, 617, 619, 641, 643, 661, 677
Offset: 1

Views

Author

Clark Kimberling, Nov 21 2022

Keywords

Comments

This sequence, together with A358528 and A181424, partition the set of primes >= 5. The corresponding sequences of indices, A358531, A358529, and A356347, partition the set of positive integers >= 3.

Examples

			  n           1   2   3   4   5   6   7
  k           6   8  11  13  14  18  20
  prime(n)   13  19  31  41  43  61  71
		

Crossrefs

Programs

  • Mathematica
    t = Select[2 + Range[140],
    Prime[#] - Prime[# - 1] < Prime[# - 1] - Prime[# - 2] &]  (* A358531 *)
    Prime[t]  (* A358530 *)

Formula

a(n) = A151800(A051634(n)). - Andrew Howroyd, Sep 21 2024

Extensions

Incorrect formula removed by Georg Fischer, Sep 21 2024

A358531 Indices of the primes in A358530.

Original entry on oeis.org

6, 8, 11, 13, 14, 18, 20, 21, 23, 26, 27, 29, 32, 34, 36, 39, 42, 44, 46, 49, 50, 53, 55, 58, 60, 61, 64, 65, 68, 70, 74, 76, 79, 82, 84, 86, 89, 90, 93, 94, 96, 99, 101, 103, 105, 108, 110, 113, 114, 116, 117, 121, 123, 127, 129, 130, 132, 134, 135, 137
Offset: 1

Views

Author

Clark Kimberling, Nov 21 2022

Keywords

Comments

This sequence, together with A358529 and A356347, partition the set of positive integers >= 3.

Examples

			  n       1   2   3   4   5   6   7
  k       6   8  11  13  14  18  20
  p(n)   13  19  31  41  43  61  71
		

Crossrefs

Programs

  • Mathematica
    t = Select[2 + Range[140],
    Prime[#] - Prime[# - 1] < Prime[# - 1] - Prime[# - 2] &]  (* A358531 *)
    Prime[t]  (* A358530 *)

Formula

a(n) = A258026(n) + 2.

A366414 Primes p such that p and the four previous primes are in arithmetic progression.

Original entry on oeis.org

9843139, 37772549, 53868769, 71427877, 78364669, 79080697, 98150141, 99591553, 104437009, 106457629, 111267539, 121174931, 121174961, 168236239, 199450219, 203909011, 207068923, 216618307, 230952979, 234058991, 235524901, 253412437, 263651281, 268843153, 294485483, 296239907
Offset: 1

Views

Author

Harvey P. Dale, Oct 09 2023

Keywords

Examples

			9843019, 9843049, 9843079, 9843109, 9843139 are the 5 consecutive primes starting from A059044(1) and ending at a(1).
		

Crossrefs

Programs

  • Mathematica
    Select[Partition[Prime[Range[10^7]],5,1],Length[Union[Differences[#]]]==1&][[;;,5]]
Showing 1-10 of 10 results.