login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A354369 Successive pairs of terms (a, b) such that (a + b) is a prime number and at least one of a and b is a prime number. This is the lexicographically earliest infinite sequence of distinct terms > 0 with this property. 5
1, 2, 3, 4, 5, 6, 7, 10, 8, 11, 12, 17, 13, 16, 14, 23, 18, 19, 20, 41, 22, 31, 24, 29, 26, 47, 28, 43, 30, 37, 32, 71, 34, 67, 36, 53, 38, 59, 40, 61, 42, 89, 44, 83, 46, 103, 48, 79, 50, 101, 52, 97, 54, 73, 56, 107, 58, 109, 60, 113, 62, 131, 64, 127, 66, 157, 68, 173, 70, 163, 72, 139, 74, 137 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
COMMENTS
The terms 9, 15, 21, 25, 27, 33, 35, 39, 45, 49, 51, ... will never appear in the sequence; they form A071904, the "Odd composite numbers".
LINKS
Michael De Vlieger, Annotated log-log scatterplot of a(n), n = 1..10^4, showing records in red, local minima in blue, composite powers of 2 in magenta, and fixed points in gold.
EXAMPLE
The earliest pairs with their prime sum: (1, 2) = 3, (3, 4) = 7, (5, 6) = 11, (7, 10) = 17, (8, 11) = 19, (12, 17) = 29, (13, 16) = 29, (14, 23) = 37, etc.
MATHEMATICA
nn = 120; c[_] = 0; a[1] = c[1] = 1; u = 2; Do[k = u; If[EvenQ[i], While[Nand[c[k] == 0, PrimeQ[# + k]] &[a[i - 1]], k++]]; Set[{a[i], c[k]}, {k, i}]; If[k == u, While[Or[c[u] > 0, And[OddQ[u], CompositeQ[u]]], u++]], {i, 2, nn}]; Array[a, nn] (* Michael De Vlieger, May 24 2022 *)
PROG
(Python)
from sympy import isprime
from itertools import islice
def agen(): # generator of terms
i, j, v, aset = 1, 2, 3, set()
while True:
aset.update((i, j)); yield from (i, j)
i = v
while i in aset or (i%2 == 1 and not isprime(i)):
i += 1
j, p = v, isprime(i)
while j==i or j in aset or not (isprime(i+j) and (p or isprime(j))):
j += 1
while v in aset: v += 1
print(list(islice(agen(), 74))) # Michael S. Branicky, Jun 24 2022
CROSSREFS
Cf. A354367, A354368, A354370 (same idea), A071904.
Sequence in context: A072794 A181820 A371249 * A199426 A119257 A266645
KEYWORD
nonn
AUTHOR
Eric Angelini and Carole Dubois, May 24 2022
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified July 22 07:42 EDT 2024. Contains 374481 sequences. (Running on oeis4.)