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

A225495 Numbers having only weak prime factors, cf. A051635.

Original entry on oeis.org

1, 3, 7, 9, 13, 19, 21, 23, 27, 31, 39, 43, 47, 49, 57, 61, 63, 69, 73, 81, 83, 89, 91, 93, 103, 109, 113, 117, 129, 131, 133, 139, 141, 147, 151, 161, 167, 169, 171, 181, 183, 189, 193, 199, 207, 217, 219, 229, 233, 241, 243, 247, 249, 267, 271, 273, 279
Offset: 1

Views

Author

Reinhard Zumkeller, May 09 2013

Keywords

Examples

			a(10) = 31 = A051635(6);
a(11) = 39 = 3 * 13 = A051635(1) * A051635(3);
a(12) = 43 = A051635(7);
a(13) = 47 = A051635(8);
a(14) = 49 = 7^2 = A051635(2)^2;
a(15) = 57 = 3 * 19 = A051635(1) * A051635(4).
		

Crossrefs

Cf. A225493 (strong), A225494 (balanced), A225496 (non-balanced).

Programs

  • Haskell
    import Data.Set (singleton, fromList, union, deleteFindMin)
    a225495 n = a225495_list !! (n-1)
    a225495_list = 1 : h (singleton p) ps [p] where
       (p:ps) = a051635_list
       h s xs'@(x:xs) ys
         | m > x     = h (s `union` (fromList $ map (* x) (1 : ys))) xs ys
         | otherwise = m : h (s' `union` (fromList $ map (* m) ys')) xs' ys'
         where ys' = m : ys; (m, s') = deleteFindMin s

Formula

Multiplicative closure of A051635.

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

A036263 Second differences of primes.

Original entry on oeis.org

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

Views

Author

Keywords

Examples

			a(3) = 5 + 11 - 2*7 = 16 - 14 = 2.
		

Crossrefs

For records see A293154, A293155.

Programs

  • Haskell
    a036263 n = a036263_list !! (n-1)
    a036263_list = zipWith (-) (tail a001223_list) a001223_list
    -- Reinhard Zumkeller, Oct 29 2011
    
  • Maple
    A036263:=n->ithprime(n) + ithprime(n+2) - 2*ithprime(n+1); seq(A036263(n), n=1..100); # Wesley Ivan Hurt, Apr 01 2014
  • Mathematica
    Table[Prime[n - 1] + Prime[n + 1] - 2*Prime[n], {n, 2, 105}]
    Differences[Prime[Range[100]], 2] (* Harvey P. Dale, Oct 14 2012 *)
  • PARI
    for(n=2,100,print1(prime(n+2)-2*prime(n+1)+prime(n)","))
    
  • Python
    from sympy import prime
    def A036263(n): return prime(n)-(prime(n+1)<<1)+prime(n+2) # Chai Wah Wu, Sep 28 2024

Formula

a(A064113(n)) = 0. - Reinhard Zumkeller, Jan 20 2012
a(n) = prime(n) + prime(n+2) - 2*prime(n+1). - Thomas Ordowski, Jul 21 2012
Conjecture: |a(1)| + |a(2)| + ... + |a(n)| ~ prime(n). - Thomas Ordowski, Jul 21 2012
a(n) = A001223(n+1) - A001223(n). - R. J. Mathar, Sep 19 2013
Sum_{i = 1..n - 1} a(i) = A046933(n), n >= 1. - Daniel Forgues, Apr 15 2014
Sum_{i = 2..n - 1} a(i) = prime(n + 1) - prime(n) - 2; Sum_{i = 2..n - 1} a(i) = 0 whenever prime(n) is a lesser of twin primes. - Hamdi Murat Yildirim, Jun 24 2014

A051634 Strong primes: prime(k) > (prime(k-1) + prime(k+1))/2.

Original entry on oeis.org

11, 17, 29, 37, 41, 59, 67, 71, 79, 97, 101, 107, 127, 137, 149, 163, 179, 191, 197, 223, 227, 239, 251, 269, 277, 281, 307, 311, 331, 347, 367, 379, 397, 419, 431, 439, 457, 461, 479, 487, 499, 521, 541, 557, 569, 587, 599, 613, 617, 631, 641, 659, 673, 701
Offset: 1

Views

Author

Felice Russo, Nov 15 1999

Keywords

Comments

Prime(k) such that prime(k) - prime(k-1) > prime(k+1) - prime(k). - Juri-Stepan Gerasimov, Jan 01 2011
a(n) > A051635(n). - Thomas Ordowski, Jul 25 2012
The inequality above is false. The least counterexample is a(19799) = 496283 < A051635(19799) = 496291. - Amiram Eldar, Nov 26 2023
Conjecture: Limit_{N->oo} Sum_{n=1..N} (NextPrime(a(n))-a(n)) / a(N) = 1/4. [A heuristic proof is available at www.primepuzzles.net - Conjecture 91] - Alain Rocchelli, Nov 14 2022
A131499 is a subsequence. - Davide Rotondo, Oct 16 2023

Examples

			11 belongs to the sequence because 11 > (7 + 13)/2.
		

References

  • A. Murthy, Smarandache Notions Journal, Vol. 11 N. 1-2-3 Spring 2000.

Crossrefs

Subsequence of A178943.
Cf. A225493 (multiplicative closure), A131499 (subsequence).

Programs

  • Haskell
    a051634 n = a051634_list !! (n-1)
    a051634_list = f a000040_list where
       f (p:qs@(q:r:ps)) = if 2 * q > (p + r) then q : f qs else f qs
    -- Reinhard Zumkeller, May 09 2013
    
  • Maple
    q:= n-> isprime(n) and 2*n>prevprime(n)+nextprime(n):
    select(q, [$3..1000])[];  # Alois P. Heinz, Jun 21 2023
  • Mathematica
    Transpose[Select[Partition[Prime[Range[10^2]], 3, 1], #[[2]]>(#[[1]]+#[[3]])/2 &]][[2]] (* Vladimir Joseph Stephan Orlovsky, May 01 2008 *)
    p=Prime[Range[200]]; p[[Flatten[1+Position[Sign[Differences[p,2]], -1]]]]
  • PARI
    p=2;q=3;forprime(r=5,1e4,if(2*q>p+r,print1(q", "));p=q;q=r) \\ Charles R Greathouse IV, Jul 19 2011
    
  • Python
    from sympy import nextprime
    def aupto(limit):
        alst, p, q, r = [], 2, 3, 5
        while q <= limit:
            if 2*q > p + r: alst.append(q)
            p, q, r = q, r, nextprime(r)
        return alst
    print(aupto(701)) # Michael S. Branicky, Nov 17 2021

Formula

Conjecture: Limit_{n->oo} n / PrimePi(a(n)) = 1/2. - Alain Rocchelli, Mar 17 2024

A054840 Seventh term of weak prime septet: p(m-5)-p(m-6) < p(m-4)-p(m-5) < p(m-3)-p(m-4) < p(m-2)-p(m-3) < p(m-1)-p(m-2) < p(m)-p(m-1).

Original entry on oeis.org

15427, 64997, 68261, 68947, 129023, 129037, 143567, 154153, 158071, 192461, 221773, 222493, 244529, 249797, 285421, 318737, 337327, 354421, 357967, 374287, 385471, 394787, 402631, 402691, 419687, 439253, 442003, 448519, 457459, 457739, 458309, 482569, 528041, 529927, 577589, 582809
Offset: 1

Views

Author

Henry Bottomley, Apr 10 2000

Keywords

Crossrefs

Cf. A051635; A054800 .. A054803: members of balanced prime quartets (= consecutive primes in arithmetic progression); A054804 .. A054818: members of strong prime quartet, quintet, sextet; A054819 .. A054840: members of weak prime quartet, quintet, sextet, septets.

Programs

  • Mathematica
    Select[Partition[Prime[Range[50000]],7,1],Min[Differences[#,2]]>0&][[;;,7]] (* Harvey P. Dale, Aug 25 2024 *)

Formula

a(n) = nextprime(A054839), nextprime = A151800;
A054840 = { A054833(n) | A054833(n) = nextprime(A054833(n-1)) }. - M. F. Hasler, Oct 27 2018

Extensions

Edited and more terms from M. F. Hasler, Oct 27 2018

A054819 First term of weak prime quartet: p(m+1)-p(m) < p(m+2)-p(m+1) < p(m+3)-p(m+2).

Original entry on oeis.org

17, 41, 79, 107, 227, 281, 311, 347, 349, 379, 397, 439, 461, 499, 569, 641, 673, 677, 827, 857, 881, 907, 1031, 1061, 1091, 1187, 1229, 1277, 1301, 1319, 1367, 1427, 1429, 1451, 1487, 1489, 1549, 1607, 1619, 1621, 1697, 1877, 1997, 2027, 2087, 2153
Offset: 1

Views

Author

Henry Bottomley, Apr 10 2000

Keywords

Examples

			From _Gus Wiseman_, May 31 2020: (Start)
The first 10 strictly increasing prime gap quartets:
   17   19   23   29
   41   43   47   53
   79   83   89   97
  107  109  113  127
  227  229  233  239
  281  283  293  307
  311  313  317  331
  347  349  353  359
  349  353  359  367
  379  383  389  397
(End)
		

Crossrefs

Prime gaps are A001223.
Second prime gaps are A036263.
Strictly decreasing prime gap quartets are A335278.
Strictly increasing prime gap quartets are A335277.
Equal prime gap quartets are A090832.
Weakly increasing prime gap quartets are A333383.
Weakly decreasing prime gap quartets are A333488.
Unequal prime gap quartets are A333490.
Partially unequal prime gap quartets are A333491.
Positions of adjacent equal prime gaps are A064113.
Positions of strict ascents in prime gaps are A258025.
Positions of strict descents in prime gaps are A258026.
Positions of adjacent unequal prime gaps are A333214.
Positions of weak ascents in prime gaps are A333230.
Positions of weak descents in prime gaps are A333231.
Lengths of maximal weakly decreasing sequences of prime gaps are A333212.
Lengths of maximal strictly increasing sequences of prime gaps are A333253.

Programs

  • Mathematica
    wpqQ[lst_]:=Module[{diffs=Differences[lst]},diffs[[1]]Harvey P. Dale, Jun 12 2012 *)
    ReplaceList[Array[Prime,100],{_,x_,y_,z_,t_,_}/;y-xx] (* Gus Wiseman, May 31 2020 *)

Formula

a(n) = prime(A335277(n)). - Gus Wiseman, May 31 2020

A046869 Good primes (version 1): prime(n)^2 > prime(n-1)*prime(n+1).

Original entry on oeis.org

5, 11, 17, 29, 37, 41, 53, 59, 67, 71, 79, 97, 101, 107, 127, 137, 149, 157, 163, 173, 179, 191, 197, 211, 223, 227, 239, 251, 257, 263, 269, 277, 281, 307, 311, 331, 347, 367, 373, 379, 397, 419, 431, 439, 457, 461, 479, 487, 499, 521, 541
Offset: 1

Views

Author

Keywords

Comments

Also called geometrically strong primes. - Amarnath Murthy, Mar 08 2002
The idea can be extended by defining a geometrically strong prime of order k to be a prime that is greater than the geometric mean of r neighbors on both sides for all r = 1 to k but not for r = k+1. Similar generalizations can be applied to the sequence A051634. - Amarnath Murthy, Mar 08 2002
It appears that a(n) ~ 2*prime(n). - Thomas Ordowski, Jul 25 2012
Conjecture: primes p(n) such that 2*p(n) >= p(n-1) + p(n+1). - Thomas Ordowski, Jul 25 2012
Probably {3,7,23} U {good primes} = {primes p(n) > 2/(1/p(n-1) + 1/p(n+1))}. - Thomas Ordowski, Jul 27 2012
Except for A001359(1), A001359 is a subsequence. - Chai Wah Wu, Sep 10 2019

Examples

			37 is a member as 37^2 = 1369 > 31*41 = 1271.
		

References

  • R. K. Guy, Unsolved Problems in Number Theory, Section A14.

Crossrefs

Programs

  • Magma
    [NthPrime(n): n in [2..100] | NthPrime(n)^2 gt NthPrime(n-1)*NthPrime(n+1)]; // Bruno Berselli, Oct 23 2012
  • Maple
    with(numtheory): a := [ ]: P := [ ]: M := 300: for i from 2 to M do if p(i)^2>p(i-1)*p(i+1) then a := [ op(a),i ]; P := [ op(P),p(i) ]; fi; od: a; P;
  • Mathematica
    Do[ If[ Prime[n]^2 > Prime[n - 1]*Prime[n + 1], Print[ Prime[n] ] ], {n, 2, 100} ]
    Transpose[Select[Partition[Prime[Range[300]],3,1],#[[2]]^2>#[[1]]#[[3]]&]][[2]] (* Harvey P. Dale, May 13 2012 *)
    Select[Prime[Range[2, 100]], #^2 > NextPrime[#]*NextPrime[#, -1] &] (* Jayanta Basu, Jun 29 2013 *)
  • PARI
    forprime(n=o=p=3,999,o+0<(o=p)^2/(p=n) & print1(o", "))
    isA046869(p)={ isprime(p) & p^2>precprime(p-1)*nextprime(p+1) } \\ M. F. Hasler, Jun 15 2011
    

Extensions

Corrected and extended by Robert G. Wilson v, Dec 06 2000
Edited by N. J. A. Sloane at the suggestion of Giovanni Resta, Aug 20 2007

A229832 First term of smallest sequence of n consecutive weak primes.

Original entry on oeis.org

3, 19, 349, 2909, 15377, 128983, 1319411, 17797519, 94097539, 6927837559, 48486712787, 968068681519, 1472840004019, 129001208165719
Offset: 1

Views

Author

Jonathan Sondow, Oct 13 2013

Keywords

Comments

Erdős called a weak prime A051635 an "early prime," defined to be one which is less than the arithmetic mean of the prime before it and the prime after it. He conjectured that there are infinitely many consecutive pairs of early primes, and offered $100 for a proof and $25000 for a disproof. See Kuperberg 1992.
I make the stronger conjecture that the sequence a(n) is infinite.
a(1) = A051635(1), a(2) = A054820(1), a(3) = A054824(1), a(4) = A054829(1), a(5) = A054835(1).
a(n) is the prime following A158939(n+1). [Follows from the definitions] - Chris Boyd, Mar 28 2015

Examples

			The primes 19 < (17+23)/2 and 23 < (19+29)/2 are the smallest pair of consecutive weak/early primes, so a(2) = 19.
		

Crossrefs

Formula

a(n) = min{p(i): 2*p(i+j) < p(i+j-1) + p(i+j+1), j = 0,1,..,n-1}.

Extensions

a(6) corrected by and a(7)-a(13) from Giovanni Resta, Jan 16 2014
a(14) from Giovanni Resta, Apr 19 2016

A054805 Second term of strong prime quartets: prime(m+1)-prime(m) > prime(m+2)-prime(m+1) > prime(m+3)-prime(m+2).

Original entry on oeis.org

37, 67, 97, 223, 277, 307, 457, 479, 613, 631, 719, 751, 853, 877, 929, 1087, 1297, 1423, 1447, 1471, 1543, 1657, 1663, 1693, 1733, 1777, 1783, 1847, 1861, 1867, 1987, 1993, 2053, 2137, 2333, 2371, 2377, 2459, 2467, 2503, 2521, 2531, 2579, 2609, 2647
Offset: 1

Views

Author

Henry Bottomley, Apr 10 2000

Keywords

Comments

Second member of pairs of consecutive primes in A051634 (strong primes). - M. F. Hasler, Oct 27 2018

Crossrefs

Cf. A051634, A051635; A054800 .. A054803: members of balanced prime quartets (= consecutive primes in arithmetic progression); A054804 .. A054818: members of strong prime quartet, quintet, sextet; A054819 .. A054840: members of weak prime quartet, quintet, sextet, septets.

Formula

a(n) = nextprime(A054804(n))= prevprime(A054806(n)), nextprime = A151800, prevprime = A151799. - M. F. Hasler, Oct 27 2018

Extensions

Offset corrected to 1 by M. F. Hasler, Oct 27 2018
Definition clarified by N. J. A. Sloane, Aug 28 2021

A054807 Fourth term of strong prime quartets: prime(m+1)-prime(m) > prime(m+2)-prime(m+1) > prime(m+3)-prime(m+2).

Original entry on oeis.org

43, 73, 103, 229, 283, 313, 463, 491, 619, 643, 733, 761, 859, 883, 941, 1093, 1303, 1429, 1453, 1483, 1553, 1667, 1669, 1699, 1747, 1787, 1789, 1867, 1871, 1873, 1997, 1999, 2069, 2143, 2341, 2381, 2383, 2473, 2477, 2531, 2539, 2543, 2593, 2621, 2659
Offset: 1

Views

Author

Henry Bottomley, Apr 10 2000

Keywords

Crossrefs

Cf. A051634, A051635; A054800 .. A054803: members of balanced prime quartets (= 4 consecutive primes in arithmetic progression); A054804 .. A054818: members of strong prime quartet, quintet, sextet; A054819 .. A054840: members of weak prime quartet, quintet, sextet, septets.

Formula

a(n) = nextprime(A054806(n)), nextprime = A151800. - M. F. Hasler, Oct 27 2018

Extensions

Offset corrected to 1 by M. F. Hasler, Oct 27 2018
Definition clarified by N. J. A. Sloane, Aug 28 2021.
Showing 1-10 of 49 results. Next