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-4 of 4 results.

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

A054643 Primes prime(n) such that prime(n) + prime(n+1) + prime(n+2) == 0 (mod 3).

Original entry on oeis.org

3, 47, 151, 167, 199, 251, 257, 367, 503, 523, 557, 587, 601, 647, 727, 941, 971, 991, 1063, 1097, 1117, 1181, 1217, 1231, 1361, 1453, 1493, 1499, 1531, 1741, 1747, 1753, 1759, 1889, 1901, 1907, 2063, 2161, 2281, 2393, 2399, 2411, 2441, 2671, 2897, 2957
Offset: 1

Views

Author

Labos Elemer, May 15 2000

Keywords

Comments

The 2 differences of these 3 primes should be congruent of 6, except the first prime 3, for which 3 + 5 + 7 = 15 holds. Sequences like A047948, A052198 etc. are subsequences here.

Examples

			For prime(242) = 1531, the sum is 4623, the mean is 1541 and the successive differences are 6a=12 or 6b=6 resp.
		

Crossrefs

A122535 is a subsequence.
Cf. A075541 (for their indices).

Programs

  • Mathematica
    Select[Partition[Prime@ Range@ 430, 3, 1], Divisible[Total@ #, 3] &][[All, 1]] (* Michael De Vlieger, Jun 29 2017 *)

A075540 Integers that are the average of three successive primes.

Original entry on oeis.org

5, 53, 157, 173, 211, 257, 263, 373, 511, 537, 563, 593, 607, 653, 733, 947, 977, 999, 1073, 1103, 1123, 1187, 1223, 1239, 1367, 1461, 1501, 1511, 1541, 1747, 1753, 1763, 1773, 1899, 1907, 1917, 2071, 2181, 2287, 2401, 2409, 2417, 2449, 2677, 2903, 2963
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 the sequence.
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 the first 10000 terms of the sequence there are 2417 primes. Indices i(n) of first prime in sequence of three primes with integer average are in A075541, for prime 3-averages i(n) are in A064113. Interprimes (s-averages with s=2) are all composite, see A024675. (Edited by Zak Seidov, Sep 01 2015 )

Examples

			a(1) = 5 = (1/3)(3+5+7), first integer average of three successive primes; next is: a(2) = 53 = (1/3)(47 + 53 + 59); up to n=8 all terms are prime; while a(9) = 511 = (1/3)( 503 + 509 + 521) is the first nonprime 3-average: 511=7*73.
		

Crossrefs

Programs

  • Haskell
    a075540 n = a075540_list !! (n-1)
    a075540_list = map fst $ filter ((== 0) . snd) $
       zipWith3 (\x y z -> divMod (x + y + z) 3)
                a000040_list (tail a000040_list) (drop 2 a000040_list)
    -- Reinhard Zumkeller, Jan 20 2012
  • Maple
    N:= 10^4: # to get all terms using primes <= N
    Primes:= select(isprime,[2,seq(2*i+1, i=1..(N-1)/2)]):
    select(type,(Primes[1..-3] + Primes[2..-2] + Primes[3..-1])/3,integer); # Robert Israel, Sep 01 2015
  • Mathematica
    Select[MovingAverage[Prime[Range[500]],3],IntegerQ] (* Harvey P. Dale, Aug 10 2012 *)

Formula

a(n) = (1/3) (p(i)+p(i+1)+p(i+2)), for some i(n).

Extensions

Comment and example edited, inefficient Mma removed by Zak Seidov, Sep 01 2015

A109406 Numbers m such that (sp(m)+sp(m+1)+sp(m+2))/3 is an integer, where sp(n) = n-th semiprime.

Original entry on oeis.org

3, 4, 9, 10, 11, 14, 20, 28, 29, 32, 34, 40, 43, 44, 45, 46, 50, 53, 58, 59, 61, 62, 63, 68, 69, 72, 74, 80, 83, 86, 89, 95, 99, 100, 101, 105, 107, 109, 111, 112, 115, 116, 118, 119, 121, 123, 127, 129, 130, 131, 132, 136, 137, 140, 144, 145, 150, 151, 152, 153, 155
Offset: 1

Views

Author

Zak Seidov, Jun 27 2005

Keywords

Examples

			3 is OK because (sp(3)+sp(4)+sp(5))/3=(9+10+14)/3 = 11; sp(n) = n-th semiprime.
		

Crossrefs

Cf. A075541.

Programs

Showing 1-4 of 4 results.