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 21-30 of 108 results. Next

A067970 First differences of A014076, the odd nonprimes.

Original entry on oeis.org

8, 6, 6, 4, 2, 6, 2, 4, 6, 4, 2, 4, 2, 6, 2, 4, 6, 2, 4, 4, 2, 4, 2, 2, 4, 6, 6, 4, 2, 2, 2, 2, 2, 4, 4, 2, 6, 2, 2, 2, 6, 2, 4, 2, 4, 4, 2, 4, 2, 6, 2, 2, 2, 6, 6, 2, 2, 2, 2, 4, 2, 2, 2, 2, 4, 6, 4, 2, 6, 2, 2, 2, 4, 2, 4, 2, 4, 2, 6, 2, 4, 6, 2, 2, 2, 4, 2, 2, 2, 2, 2, 4, 6, 4, 2, 2, 2, 2, 2, 4, 2, 4, 2, 2, 2
Offset: 1

Views

Author

Labos Elemer, Feb 04 2002

Keywords

Comments

In this sequence 8 occurs once, but 2,4,6 may occur several times. No other even number arises. Therefore sequence consists of {8,6,4,2}.
Proof: If x is an odd nonprime, then x+2=next-odd-number is either nonprime[Case1] or it is a prime [Case 2]. In Case 1 the difference is 2. E.g., x=25, x+2=27, the actual difference is d=2.
In Case 2 x+2=p=prime. Distinguish two further subcases. In Case 2a: x+2=p=prime and p+2=x+4=q is also a prime. Then x+2+2+2=x+6 will not be prime because in first difference sequence of prime no d=2 occurs twice except for p+2=3+2=5,5+2=7, i.e., when p is divisible by 3; for 6k+1 and 6k+5 primes it is impossible. Consequently x+6 is not a prime and so the difference between two consecutive odd nonprimes is 6. Example: x=39, x+2=41=smaller twin prime and next odd nonprime x+6=45, d=6
In Case 2b: x+2=p=prime, but x+2+2=x+4 is not a prime, i.e., x+2=p is not a smaller one of a twin-prime pair. Thus x+4 is the next odd nonprime. Thus the difference=4. E.g., x=77, x+2=79, so the next odd nonprime is x+4=81, d=4. No more cases. QED.
Interestingly this sequence picks out the twin primes.
That the first term is special is a reflection of the simple fact that there are no 3 consecutive odd primes except from 3, 5, 7 corresponding to A067970(1) = 8 = 9-1 = (7+2)-(3-2). - Frank Ellermann, Feb 08 2002
There are arbitrarily long runs of 2's, but not of 4's or 6's. - Zak Seidov, Oct 01 2011

Crossrefs

Programs

  • Haskell
    a067970 n = a067970_list !! (n-1)
    a067970_list = zipWith (-) (tail a014076_list) a014076_list
    -- Reinhard Zumkeller, Sep 30 2011
    
  • Mathematica
    a = Select[ Range[300], !PrimeQ[ # ] && !EvenQ[ # ] & ]; Table[ a[[n + 1]] - a[[n]], {n, 1, Length[a] - 1} ]
    With[{nn=401},Differences[Complement[Range[1,nn,2],Prime[Range[PrimePi [nn]]]]]]  (* Harvey P. Dale, Feb 05 2012 *)
  • Python
    from sympy import primepi, isprime
    def A067970(n):
        if n == 1: return 8
        m, k = n-1, primepi(n) + n - 1 + (n>>1)
        while m != k:
            m, k = k, primepi(k) + n - 1 + (k>>1)
        for d in range(2,7,2):
            if not isprime(m+d):
                return d # Chai Wah Wu, Jul 31 2024

Formula

a(n) = A014076(n+1) - A014076(n).
a(n) = 2 * A196274(n); a(A196276(n)) = 2; a(A196277(n)) > 2. - Reinhard Zumkeller, Sep 30 2011

Extensions

Edited by Robert G. Wilson v, Feb 08 2002
Offset changed to 1 by Jason Yuen, Jan 08 2025

A126784 Primes p such that q-p = 32, where q is the next prime after p.

Original entry on oeis.org

5591, 10799, 27701, 27851, 33647, 39047, 41081, 41687, 43721, 44417, 45989, 47459, 50789, 52457, 55259, 55547, 61781, 62351, 64817, 66239, 67307, 69959, 73907, 79907, 80567, 82307, 84089, 88037, 94169, 94961, 99191, 99929, 100559, 102611
Offset: 1

Views

Author

Douglas Winston (douglas.winston(AT)srupc.com), Feb 24 2007

Keywords

Comments

Lower prime of a difference of 32 between consecutive primes.

Crossrefs

Programs

  • PARI
    lista(nn) = {p = 2; while (p < nn, q = nextprime(p+1); if (q - p == 32, print1(p, ", ")); p = q;);} \\ Michel Marcus, Jul 17 2013

A229021 Record values in A226657.

Original entry on oeis.org

5, 7, 23, 389, 409, 1511, 5309, 7351, 37223, 142811, 763271, 8066923, 9182389, 10237391, 24374033, 70353383, 128463691, 334100083, 358453847, 610611193
Offset: 1

Views

Author

Arkadiusz Wesolowski, Sep 11 2013

Keywords

Crossrefs

A229028 Indices of records in A226657.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 9, 10, 13, 16, 23, 29, 31, 34, 37, 41, 44, 52, 53
Offset: 1

Views

Author

Arkadiusz Wesolowski, Sep 11 2013

Keywords

Crossrefs

A229030 Smallest of the first six consecutive primes that comprise three sets of primes with difference 2*n.

Original entry on oeis.org

5, 7, 251, 683, 2017, 18679, 13499, 608131, 97213, 937127, 891997, 531359, 490283, 637171, 892321, 21954731, 5995783, 3440627, 12024413, 3697249, 2674579, 95270633, 165066283, 25091659, 465512447, 161732947, 88360297, 804346451, 286775719, 198215821
Offset: 1

Views

Author

Arkadiusz Wesolowski, Sep 11 2013

Keywords

Comments

An equivalent definition of this sequence: smallest prime which gives a cluster of primes with the spacing pattern 2*n; x; 2*n; x; 2*n, x > 0.
A229033 gives the record values.

Examples

			Difference two - primes: 5, 7, 11, 13, 17, 19.
Difference four - primes: 7, 11, 13, 17, 19, 23.
Difference six - primes: 251, 257, 263, 269, 271, 277.
		

Crossrefs

Programs

  • Mathematica
    Table[With[{prs=Partition[Prime[Range[42000000]],6,1]},Select[prs, Union[ Take[ Differences[#1],{1,5,2}]]=={2n}&,1][[1,1]]],{n,30}] (* Harvey P. Dale, Apr 18 2014 *)

A229033 Record values in A229030.

Original entry on oeis.org

5, 7, 251, 683, 2017, 18679, 608131, 937127, 21954731, 95270633, 165066283, 465512447, 804346451
Offset: 1

Views

Author

Arkadiusz Wesolowski, Sep 11 2013

Keywords

Crossrefs

A229034 Indices of records in A229030.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 8, 10, 16, 22, 23, 25, 28
Offset: 1

Views

Author

Arkadiusz Wesolowski, Sep 11 2013

Keywords

Crossrefs

A274121 The gap prime(n+1) - prime(n) occurs for the a(n)-th time.

Original entry on oeis.org

1, 1, 2, 1, 3, 2, 4, 3, 1, 5, 2, 4, 6, 5, 3, 4, 7, 5, 6, 8, 6, 7, 7, 1, 8, 9, 9, 10, 10, 1, 11, 8, 11, 1, 12, 9, 10, 12, 11, 12, 13, 2, 14, 13, 15, 1, 2, 14, 16, 15, 13, 17, 3, 14, 15, 16, 18, 17, 16, 19, 4, 2, 17, 20, 18, 3, 18, 5, 21, 19, 19, 2, 20, 21, 20, 22, 3, 21, 4, 6, 22, 7, 23, 23, 22, 24, 5, 23, 24, 24, 3, 6
Offset: 1

Views

Author

David A. Corneth, Jun 10 2016

Keywords

Comments

Terms of this sequence grow without bound; any even number occurs in this sequence. Zhang proved that there are infinitely many primes 4680 apart from each other (see link "Bounded gaps between primes").
For a conjectured count of gap n below x, see link Polignac's conjecture.
Polignac's conjecture states that "For any positive even number n, there are infinitely many prime gaps of size n.". By this conjecture, every positive apppears infinitely many times in this sequence (see link "Polignac's conjecture").

Examples

			(p, g) denotes a prime p and the gap up to the next prime. So p + g is the next prime after p. These pairs start (2, 1), (3, 2), (5, 2), (7, 4), (11, 2). From here we see that:
- the gap after the first prime, 1 occurs for the first time, so a(1) = 1.
- the gap after the second prime, 2, occurs for the first time, so a(2) = 1.
- the gap after the third prime, 2, occurs for the second time, so a(3) = 2.
- the gap after the fourth prime, 4, occurs for the first time, so a(4) = 1.
- the gap after the fifth prime, 2, occurs for the third time, so a(5) = 3.
		

Crossrefs

Programs

  • PARI
    \\ See link by name "PARI program" for an extended version with comments.
    upto(n) = {my(gapcount=List(), freqgap = List([1])); n = max(n, 3); forprime(i=3,n,
    g = nextprime(i+1) - i; for(i=#gapcount+1, g\2, listput(gapcount,0));  gapcount[g\2]++; listput(freqgap,gapcount[g\2]));freqgap} \\ David A. Corneth, Jun 28 2016

Formula

a(primepi(A000230(n))) = 1.
a(primepi(A001359(n))) = n.
a(primepi(A029710(n))) = n.

A295298 Numbers n for which sum of the divisors (A000203) and the binary weight of n (A000120) have the same parity.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 8, 10, 12, 15, 16, 17, 20, 23, 24, 25, 27, 29, 30, 32, 33, 34, 39, 40, 43, 45, 46, 48, 49, 50, 51, 53, 54, 57, 58, 60, 63, 64, 65, 66, 68, 71, 75, 77, 78, 80, 81, 83, 85, 86, 89, 90, 92, 95, 96, 98, 99, 100, 101, 102, 105, 106, 108, 111, 113, 114, 116, 119, 120, 121, 123, 125, 126, 128, 129, 130, 132, 135, 136
Offset: 1

Views

Author

Antti Karttunen, Nov 26 2017

Keywords

Comments

Numbers n for which A010060(n) = A053866(n).
This sequence is the union of all terms of A028982 (squares and twice squares) that are odious (A000069), and all evil numbers (A001969) that are neither a square or twice a square. See also A231431, A235001.
Sequence A003401 is a subsequence of this sequence. This follows because the only terms in A003401 that are squares or twice squares are the powers of 2 (A000079, that have just one 1-bit, thus are odious), while all the other terms (obtained by multiplying distinct Fermat primes possibly with some power of 2) have an even number of 1-bits, and certainly cannot be squares nor twice squares. - Antti Karttunen, Nov 27 2017

Crossrefs

Positions of zeros in A295297.
Complement of A295299.
Cf. A000079, A003401, A295296 (subsequences), also A191363 (the five known terms).

Programs

  • Mathematica
    Select[Range@ 136, SameQ @@ Map[EvenQ, {DivisorSigma[1, #], DigitCount[#, 2, 1]}] &] (* Michael De Vlieger, Nov 26 2017 *)

A075051 Smallest prime for which the n closest primes are smaller.

Original entry on oeis.org

3, 113, 113, 113, 1327, 1327, 15683, 15683, 248909, 265621, 492113, 492113, 3851459, 7743233, 18640103, 18640103, 18640103, 435917249, 435917249, 435917249, 649580171, 649580171, 19187736221, 19187736221, 19187736221, 94746870541, 94746870541, 673420121333, 1975675658371
Offset: 1

Views

Author

Neil Fernandez, Oct 10 2002

Keywords

Comments

It is surprising that few of the above entries are at the beginning of a prime gap in A000230 or A002386.

Examples

			The smallest prime number for which the three closest primes to itself are all smaller than itself is 113 (the closest primes being 109, 107 and 103). So a(3)=113.
		

Crossrefs

Programs

  • Mathematica
    NextPrim[n_] := Block[{k = n + 1}, While[ !PrimeQ[k], k++ ]; k]; PrevPrim[n_] := Block[{k = n - 1}, While[ !PrimeQ[k], k-- ]; k]; k = 1; Do[ps = Table[0, {n + 1}]; ps = Append[ps, Max[k, 1]]; While[ps = Drop[ps, 1]; ps = Append[ps, NextPrim[ ps[[ -1]]]]; ps[[ -1]] - ps[[ -2]] <= ps[[ -2]] - ps[[1]], ]; Print[ ps[[ -2]]]; k = PrevPrim[ ps[[1]]], {n, 1, 30}]

Extensions

Edited and extended by Robert G. Wilson v, Oct 12 2002
a(23)-a(29) from Donovan Johnson, Jun 19 2008
Previous Showing 21-30 of 108 results. Next