[go: up one dir, main page]

login
A230086
Lexicographically earliest permutation of the positive integers such that a(n+a(n)) is prime for all n.
2
1, 2, 3, 5, 4, 7, 6, 8, 11, 9, 10, 12, 13, 14, 15, 17, 16, 18, 19, 23, 29, 20, 21, 31, 22, 37, 24, 41, 25, 43, 26, 27, 47, 28, 30, 53, 32, 59, 33, 34, 35, 61, 67, 71, 36, 38, 73, 39, 40, 79, 83, 42, 44, 89, 97, 45, 101, 46, 103, 48, 49, 107, 109, 50
OFFSET
1,2
COMMENTS
"Lexicographically earliest" means that a(n) is chosen as small as possible, in the order of increasing n, without leading to a contradiction. "Permutation" means that no integer may appear more than once, and together with the former prescription, every integer will indeed appear.
Existence of the sequence is guaranteed since terms can be filled in one after the other, and each time the place n+a(n) (which comes later) is required to be filled with a prime. This does not prevent from filling other places with primes. Since at each step the smallest available number is used, the primes as well as the composites appear in their natural order.
It appears that the primes are exactly the "early birds" of this sequence, i.e., the terms such that a(n)>n, except for {2, 3, 13, 19} which appear in their natural position. - M. F. Hasler, Oct 09 2013
PROG
(PARI) {u=0; a=vector(1000); for(i=1, #a, a[i]>0 && next; for(x=1, 9e9, (!a[i] || isprime(x)) && !bittest(u, x) && (a[i]=x) && break); u+=1<<a[i]; i+a[i]<=#a && a[i+a[i]]=-1); vecextract(a, "..100")}
CROSSREFS
Sequence in context: A098311 A342265 A375375 * A375374 A333404 A227082
KEYWORD
nonn
AUTHOR
Eric Angelini and M. F. Hasler, Oct 08 2013
STATUS
approved