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

A206041 Values of the difference d for 7 primes in arithmetic progression with the minimal start sequence {7 + j*d}, j = 0 to 6.

Original entry on oeis.org

150, 2760, 3450, 9150, 14190, 20040, 21240, 63600, 76710, 117420, 122340, 134250, 184470, 184620, 189690, 237060, 274830, 312000, 337530, 379410, 477630, 498900, 514740, 678750, 707850, 1014540, 1168530, 1180080, 1234530, 1251690, 1263480, 1523520, 1690590
Offset: 1

Views

Author

Sameen Ahmed Khan, Feb 03 2012

Keywords

Comments

The computations were done without any assumptions on the form of d.
All terms are multiples of 30. - Zak Seidov, Jan 07 2014.
Equivalently, integers d such that the longest possible arithmetic progression (AP) of primes with common difference d has exactly 7 elements (see example). These 7 elements are not necessarily consecutive primes. In fact, for each term d, there exists only one such AP of primes, and this one always starts with A342309(d) = 7, so this unique AP is (7, 7+d, 7+2d, 7+3d, 7+4d, 7+5d, 7+6d). - Bernard Schott, Feb 12 2023

Examples

			d = 150 then {7, 7 + 1*150, 7 + 2*150, 7 + 3*150, 7 + 4*150, 7 + 5*150, + 7 + 6*150} = {7, 157, 307, 457, 607, 757, 907} which is 7 primes in arithmetic progression.
		

Crossrefs

Longest AP of prime numbers with exactly k elements: A007921 (k=1), A359408 (k=2), A206037 (k=3), A359409 (k=4), A206039 (k=5), A359410 (k=6), this sequence (k=7), A360146 (k=10), A206045 (k=11).

Programs

  • Maple
    filter := d -> isprime(7+d) and isprime(7+2*d) and isprime(7+3*d) and isprime(7+4*d) and isprime(7+5*d) and isprime(7+6*d): select(filter, [$(1 .. 1700000)]); # Bernard Schott, Feb 13 2023
  • Mathematica
    a = 7; t = {}; Do[If[PrimeQ[{a, a + d, a + 2*d, a + 3*d, a + 4*d, a + 5*d, a + 6*d}] == {True, True, True, True, True, True, True}, AppendTo[t,d]], {d, 200000}]; t

Formula

m is a term iff A123556(m) = 7. - Bernard Schott, Feb 12 2023

A359408 Integers d such that the longest possible arithmetic progression (AP) of primes with common difference d has only two elements.

Original entry on oeis.org

1, 3, 5, 9, 11, 15, 16, 17, 21, 22, 26, 27, 29, 32, 35, 39, 41, 44, 45, 46, 51, 52, 56, 57, 58, 59, 62, 65, 69, 70, 71, 74, 76, 77, 81, 82, 86, 87, 88, 92, 95, 99, 100, 101, 105, 105, 106, 107, 111, 112, 116, 118, 122, 125, 128, 129, 130, 135, 136, 137, 140, 142, 146, 147, 148, 149, 152, 155
Offset: 1

Views

Author

Bernard Schott, Dec 30 2022

Keywords

Comments

As '2 is prime' and also '2 is one less than prime 3' (see A173919), there exist two subsequences with k = 2 elements in these APs of primes (see examples).
1. If d is an odd term, then d is in A040976 \ {0} with d = prime(m) - 2, for some m >= 2, and, for each such d, there exists only one longest possible AP of primes, and this AP is always: (2, prime(m)) = (2, d+2), so starts with 2. This subsequence corresponds to the first case: '2 is prime'.
2. If d is an even term, then d is in A360735 and the longest corresponding APs of primes are of the form (q, q+d) with q odd primes. This subsequence corresponds to the second case '2 is one less than prime 3'.
A342309(d) gives the first element of the smallest AP with 2 elements whose common difference is a(n) = d.
The two elements of these APs are not necessarily consecutive primes.

Examples

			d = 1 is a term because the only longest AP of primes with common difference 1 is (2, 3) that has 2 elements because 4 is composite.
d = 3 is a term because the only longest AP of primes with common difference 3 is (2, 5) that has 2 elements because 8 is composite.
d = 5 is a term because the only longest AP of primes with common difference 5 is (2, 7) that has 2 elements because 12 is composite.
d = 16 is a term because the first longest APs of primes with common difference 16 are (3, 19), (7,23), (13, 29), ... that all have 2 elements; the first one that starts with A342309(16) = 3 is (3, 19).
d = 22 is a term because the first longest APs of primes with common difference 22 are (7, 29), (19, 41), (31, 53), ... that all have 2 elements; the first one that starts with A342309(22) = 7 is (7, 29).
		

Crossrefs

Equals disjoint union of A040976 \ {0} and A360735.
Longest AP of prime numbers with exactly k elements: A007921 (k=1), this sequence (k=2), A206037 (k=3), A359409 (k=4), A206039 (k=5), A359410 (k=6), A206041 (k=7), A360146 (k=10), A206045 (k=11)

Programs

  • Maple
    filter := d -> irem(d, 2) = 0 and irem(d, 3) <> 0 and not isprime(3+d) or irem(d, 2) = 0 and irem(d, 3) <> 0 and isprime(3+d) and not isprime(3+2*d) or isprime(d+2) : select(filter, [$(1 .. 155)]);
  • Mathematica
    Select[Range[155], Mod[#,2]==0 && Mod[#,3]!=0 && !PrimeQ[3+#] || Mod[#,2]==0 && Mod[#,3]!=0 && PrimeQ[3+#] && !PrimeQ[3+2#] || PrimeQ[#+2] &] (* Stefano Spezia, Jan 08 2023 *)

Formula

m is a term iff A123556(m) = 2.

A359409 Integers d such that the largest possible arithmetic progression (AP) of primes with common difference d has exactly four elements.

Original entry on oeis.org

18, 24, 36, 54, 66, 72, 78, 84, 102, 108, 114, 132, 138, 144, 156, 162, 168, 174, 186, 192, 198, 204, 216, 222, 228, 234, 246, 258, 264, 276, 282, 288, 294, 306, 312, 318, 324, 336, 342, 348, 354, 366, 372, 378, 384, 396, 402, 408, 414, 432, 438, 444, 456, 462, 468, 486
Offset: 1

Views

Author

Bernard Schott, Jan 23 2023

Keywords

Comments

These 4 elements are not necessarily consecutive primes.
A342309(d) gives the first element of the smallest AP with 4 elements whose common difference is a(n) = d.
All the terms are multiples of 6 (A008588) but are not multiples of 5 and also must not belong to A206039; indeed, terms d' in A206039 correspond to the largest possible arithmetic progression (AP) of primes that have exactly five elements with this common difference d'.

Examples

			d = 18 is a term because the largest possible APs of primes with common difference d = 18 have all 4 elements; the first such APs start with 5, 43, 53, ... The smallest one is (5, 23, 41, 59) then 77 is composite.
d = 24 is another term because the largest possible APs of primes with common difference d = 24 have all 4 elements; the first such APs start with 59, 79, 349, ... The smallest one is (59, 83, 107, 131) then 155 is composite.
		

Crossrefs

Subsequence of A008588.
Largest AP of prime numbers with k elements: A007921 (k=1), A359408 (k=2), A206037 (k=3), this sequence (k=4), A206039 (k=5), A359410 (k=6), A206041 (k=7).

Programs

  • PARI
    isok(d) = (d%5) && !(d%6) && !(isprime(5+d) && isprime(5+2*d) && isprime(5+3*d) && isprime(5+4*d)); \\ Michel Marcus, Jan 23 2023

Formula

m is a term iff A123556(m) = 4.

A359410 Integers d such that the longest possible arithmetic progression (AP) of primes with common difference d has exactly 6 elements.

Original entry on oeis.org

30, 60, 90, 120, 180, 240, 270, 300, 330, 360, 390, 450, 480, 510, 540, 570, 600, 660, 690, 720, 750, 780, 810, 870, 900, 930, 960, 990, 1020, 1080, 1110, 1140, 1170, 1200, 1230, 1290, 1320, 1350, 1380, 1410, 1440, 1500, 1530, 1560, 1590, 1620, 1650, 1710, 1740
Offset: 1

Views

Author

Bernard Schott, Jan 29 2023

Keywords

Comments

The 6 elements are not necessarily consecutive primes.
A342309(d) gives the first element of the smallest AP with 6 elements whose common difference is a(n) = d.
All the terms are positive multiples of 30 (A249674) but are not multiples of 7 and also must not belong to A206041; indeed, terms d' in A206041 correspond to the longest possible APs of primes that have exactly 7 elements with this common difference d'.

Examples

			d = 30 is a term because the longest possible APs of primes with common difference d = 30 all have 6 elements; the first such APs start with 7, 107, 359, .... The smallest one is (7, 37, 67, 97, 127, 157); then 187 = 11*17.
d = 60 is another term because the longest possible APs of primes with common difference d = 60 all have 6 elements; the first such APs start with 11, 53, 641, .... The smallest one is (11, 71, 131, 191, 251, 311); then 371 = 7*53.
d = 150 is not a term because the longest possible AP of primes with common difference d = 150 is (7, 157, 307, 457, 607, 757, 907) which has 7 elements; this last one is unique.
		

Crossrefs

Subsequence of A249674.
Longest AP of prime numbers with exactly k elements: A007921 (k=1), A359408 (k=2), A206037 (k=3), A359409 (k=4), A206039 (k=5), this sequence (k=6), A206041 (k=7), no sequence for (k=8) and (k=9), A360146 (k=10), A206045 (k=11).

Programs

  • Maple
    filter := d -> (irem(d, 30) = 0) and (irem(d, 7) <> 0) and not (isprime(7+d) and isprime(7+2*d) and isprime(7+3*d) and isprime(7+4*d) and isprime(7+5*d) and isprime(7+6*d)): select(filter, [$(1 .. 1740)]);

Formula

m is a term iff A123556(m) = 6.

A092953 Number of primes of the form n+p, where p is a prime < n.

Original entry on oeis.org

0, 0, 1, 1, 1, 1, 0, 2, 1, 2, 1, 3, 0, 2, 1, 3, 1, 3, 0, 3, 1, 2, 0, 6, 0, 4, 1, 3, 1, 6, 0, 3, 0, 4, 1, 6, 0, 4, 1, 5, 1, 8, 0, 4, 1, 4, 0, 7, 0, 6, 1, 4, 0, 9, 0, 8, 1, 4, 1, 11, 0, 5, 0, 5, 1, 11, 0, 6, 1, 8, 1, 9, 0, 4, 0, 7, 1, 11, 0, 7, 1, 4, 0, 13, 0, 7, 1, 5, 0, 15, 0, 7, 0, 8, 1, 13, 0, 8, 1, 9, 1, 11
Offset: 1

Views

Author

Amarnath Murthy, Mar 24 2004

Keywords

Comments

Might be called the additive primability of n.
a(A007921(n))=0; for n > 2: a(A030173(n)) > 0 and a(A040976(n)) = 1. - Reinhard Zumkeller, Nov 10 2012

Examples

			a(26) = 4: the primes are 29, 31, 37 and 43.
		

Crossrefs

Cf. A092954.
Cf. A061357.

Programs

  • Haskell
    a092953 n = sum $
       zipWith (\u v -> a010051' u * a010051' v) [1 .. n - 1] [n + 1 ..]
    -- Reinhard Zumkeller, Nov 10 2012
  • PARI
    for(n=1,105,c=0;forprime(p=2,n-1,if(isprime(n+p),c++));print1(c,","))
    

Extensions

More terms from Klaus Brockhaus and Mohammed Bouayoun (bouyao(AT)wanadoo.fr), Mar 25 2004

A360146 Integers d such that the longest possible arithmetic progression (AP) of primes with common difference d has exactly 10 elements.

Original entry on oeis.org

210, 420, 630, 840, 1050, 1260, 1470, 1680, 1890, 2100, 2520, 2730, 2940, 3150, 3360, 3570, 3780, 3990, 4200, 4410, 4830, 5040, 5250, 5460, 5670, 5880, 6090, 6300, 6510, 6720, 7140, 7350, 7560, 7770, 7980, 8190, 8400, 8610, 8820, 9030, 9450, 9660, 9870, 10080, 10290, 10500, 10710, 10920
Offset: 1

Views

Author

Bernard Schott, Mar 09 2023

Keywords

Comments

The 10 elements are not necessarily consecutive primes.
All the terms are positive multiples of 210 = 7# but are not multiples of 11 and also must not belong to A206045, where the first term is 1536160080; indeed, terms d' in A206045 correspond to the longest possible APs of primes that have exactly 11 elements with these common differences d'.
A342309(d) gives the first element of the smallest AP with 10 elements whose common difference is a(n) = d.

Examples

			d = 210 is a term because the longest possible APs of primes with common difference d = 210 all have 10 elements. The first such AP is (199, 409, 619, 829, 1039, 1249, 1459, 1669, 1879, 2089), then 2299 = 11*209.
d = 420 is another term because the longest possible APs of primes with common difference d = 420 all have 10 elements; the first such APs start with 52879, 3544939, ... The smallest one is (52879, 53299, 53719, 54139, 54559, 54979, 55399, 55819, 56239, 56659), then 57079 = 11*5189.
		

Crossrefs

Common differences for longest possible APs of primes with exactly k elements: A007921 (k=1), A359408 (k=2), A206037 (k=3), A359409 (k=4), A206039 (k=5), A359410 (k=6), A206041 (k=7), this sequence (k=10), A206045 (k=11).

Programs

  • PARI
    A053669(n) = forprime(p=2, , if(n%p, return(p)));
    f(n) = my(p=A053669(n)); for (i=1, p-1, if (!isprime(p+i*n), return(p-1))); p; \\ A123556
    isok(n) = f(n) == 10; \\ Michel Marcus, Mar 10 2023

Formula

m is a term iff A123556(m) = 10.

A204897 a(n) = (p(n)-q(n))/n, where (p(n), q(n)) is the least pair of primes for which n divides p(n)-q(n).

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 2, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 1, 2, 1, 1, 1, 2, 1, 2, 1, 1, 1, 2, 1, 2, 1, 2, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1
Offset: 1

Views

Author

Clark Kimberling, Jan 20 2012

Keywords

Comments

For a guide to related sequences, see A204892.
It seems that a(A007921(n)) = 2 for all n. - Antti Karttunen, Oct 09 2018

Examples

			(3-2)/1=1
(5-3)/2=1
(5-2)/3=1
(7-3)/4=1
(7-2)/5=1
(11-5)/6=1
(17-3)/7=2
		

Crossrefs

Programs

  • Mathematica
    (See the program at A204892.)
  • PARI
    A204897(n) = { my(d); forprime(p=3,oo, forprime(q=2,p-1,if(!((d=(p-q))%n),return(d/n),if(dAntti Karttunen, Oct 09 2018

Extensions

More terms from Antti Karttunen, Oct 09 2018

A376343 Positions of twos in the run-compressed (A037201) first differences (A001223) of the primes (A000040).

Original entry on oeis.org

2, 4, 6, 9, 12, 15, 18, 24, 26, 31, 33, 37, 39, 41, 44, 47, 50, 53, 57, 62, 73, 75, 81, 90, 95, 99, 102, 105, 108, 127, 129, 131, 135, 139, 156, 158, 161, 163, 167, 173, 182, 187, 190, 193, 196, 205, 210, 214, 216, 232, 235, 241, 244, 247, 254, 263, 265, 270
Offset: 1

Views

Author

Gus Wiseman, Sep 26 2024

Keywords

Comments

We define the run-compression of a sequence to be the anti-run obtained by reducing each run of repeated parts to a single part. Alternatively, we can remove all parts equal to the part immediately to their left. For example, (1,1,2,2,1) has run-compression (1,2,1).

Examples

			The sequence of prime numbers (A000040) is:
  2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, ...
with first differences (A001223):
  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, ...
with run-compression (A037201):
  1, 2, 4, 2, 4, 2, 4, 6, 2, 6, 4, 2, 4, 6, 2, 6, 4, 2, 6, 4, 6, 8, 4, 2, 4, 2, 4, ...
with twos at (A376343):
  2, 4, 6, 9, 12, 15, 18, 24, 26, 31, 33, 37, 39, 41, 44, 47, 50, 53, 57, 62, 73, ...
		

Crossrefs

Positions of 2's in A037201.
The repeats were at positions A064113 before being omitted.
A variation for squarefree numbers is A376342.
A000040 lists the prime numbers, differences A001223.
A000961 and A246655 list prime-powers, differences A057820.
A005117 lists squarefree numbers, differences A076259 (ones A375927).
A013929 lists nonsquarefree numbers, differences A078147.
A333254 lists run-lengths of differences between consecutive primes.

Programs

  • Mathematica
    Join@@Position[First/@Split[Differences[Select[Range[100],PrimeQ]]],2]

Formula

For just the odd primes we have a(n) - 1.

A376521 Sorted positions of first appearances in the run-compression (A037201) of the first differences (A001223) of the prime numbers (A000040).

Original entry on oeis.org

1, 2, 3, 8, 22, 28, 32, 42, 91, 141, 172, 198, 242, 259, 341, 400, 556, 692, 1119, 1737, 1779, 2072, 2101, 2913, 3126, 3204, 3246, 3457, 3598, 4294, 4383, 7596, 7651, 8284, 11986, 13729, 14220, 15101, 16273, 18217, 22303, 29523, 30243, 32236, 32808, 32820
Offset: 1

Views

Author

Gus Wiseman, Sep 26 2024

Keywords

Comments

We define the run-compression of a sequence to be the anti-run obtained by reducing each run of repeated parts to a single part. Alternatively, we can remove all parts equal to the part immediately to their left. For example, (1,1,2,2,1) has run-compression (1,2,1).

Examples

			The sequence of prime numbers (A000040) is:
  2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, ...
with first differences (A001223):
  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, ...
with run-compression (A037201):
  1, 2, 4, 2, 4, 2, 4, 6, 2, 6, 4, 2, 4, 6, 2, 6, 4, 2, 6, 4, 6, 8, 4, 2, 4, 2, 4, ...
with first appearances at (A376521):
  1, 2, 3, 8, 22, 28, 32, 42, 91, 141, 172, 198, 242, 259, 341, 400, 556, 692, 1119, ...
		

Crossrefs

These are the sorted positions of first appearances in A037201.
For positions of twos instead of first appearances we have A376343.
The unsorted version is A376520.
A000040 lists the prime numbers, differences A001223.
A003242 counts compressed compositions, ranks A333489.
A333254 lists run-lengths of differences between consecutive primes.
A373948 encodes compression using compositions in standard order.

Programs

  • Mathematica
    q=First/@Split[Differences[Select[Range[1000],PrimeQ]]];
    Select[Range[Length[q]],!MemberQ[Take[q,#-1],q[[#]]]&]

A099019 Odd composite numbers n such that n-2 and n+2 are also composite.

Original entry on oeis.org

93, 117, 119, 121, 123, 143, 145, 185, 187, 203, 205, 207, 215, 217, 219, 245, 247, 287, 289, 297, 299, 301, 303, 321, 323, 325, 327, 341, 343, 363, 393, 405, 413, 415, 425, 427, 453, 471, 473, 475, 483, 495, 513, 515, 517, 527, 529, 531, 533, 535, 537, 551
Offset: 1

Views

Author

Rick L. Shepherd, Nov 13 2004

Keywords

Comments

No term is the difference of two primes. - Juri-Stepan Gerasimov, Oct 10 2009
Goldbach's conjecture states that all even numbers > 2 can be expressed as the sum of two primes. If true, then this sequence contains all composites which cannot be expressed as the sum or difference of two primes. - Bob Selcoe, Mar 10 2015

Examples

			93 is the first term because 91=7*13, 93=3*31 and 95=5*19 are all composite and there is no smaller odd composite with both odd neighbors composite.
		

Crossrefs

Subsequence of A007921.

Programs

  • Mathematica
    Select[Range@1200, OddQ@# && AllTrue[{# - 2, #, # + 2}, CompositeQ] &] (* Michael De Vlieger, Mar 10 2015, Version 10 *)
  • PARI
    forstep(n=9,1000,2,if(!isprime(n)&&!isprime(n-2)&&!isprime(n+2),print1(n,",")))
Previous Showing 11-20 of 31 results. Next