|
Search: id:A076974
|
|
|
| A076974 |
|
Increasing sequence where each number is unequal to 2 mod all previous numbers. |
|
+0 2
|
|
| 2, 3, 7, 13, 19, 25, 31, 39, 43, 49, 55, 61, 69, 73, 81, 85, 91, 99, 103, 109, 115, 123, 129, 133, 139, 147, 151, 159, 165, 169, 175, 181, 187, 193, 199, 207, 213, 225, 229, 235, 241, 253, 259, 265, 271, 279, 283, 291, 295, 309, 313, 319, 333, 337, 349, 355
(list; graph; listen)
|
|
|
OFFSET
|
0,1
|
|
|
COMMENT
|
Can be generated quickly by modified sieve of Eratosthenes. Note that eliminating numbers that equal zero mod any previous number is exactly the sieve of Eratosthenes and generates the primes; eliminating numbers that equal one mod any previous number just gives the even numbers.
|
|
EXAMPLE
|
a(4)=13 because the smaller numbers after a(3)=7 are eliminated: 8=2 (mod 2 or 3), 9=2 (mod 7), 10=2 (mod 2), 11=2 (mod 3), 12=2 (mod 2).
|
|
PROGRAM
|
(Python: replace leading dots by blanks before running)
.def A076974():
... D = {}
... q = 2
... while True:
....... if q not in D:
........... yield q
........... D.setdefault(q+2, []).append(q)
....... else:
........... for p in D[q]:
............... D.setdefault(p+q, []).append(p)
........... del D[q]
....... q += 1
|
|
CROSSREFS
|
Sequence in context: A130903 A068828 A100764 this_sequence A051484 A101415 A045331
Adjacent sequences: A076971 A076972 A076973 this_sequence A076975 A076976 A076977
|
|
KEYWORD
|
easy,nonn
|
|
AUTHOR
|
David Eppstein (eppstein(AT)ics.uci.edu), Nov 28 2002
|
|
|
Search completed in 0.002 seconds
|