|
|
A132988
|
|
a(n) = smallest k not occurring earlier such that k divides prime(n)+1.
|
|
5
|
|
|
1, 2, 3, 4, 6, 7, 9, 5, 8, 10, 16, 19, 14, 11, 12, 18, 15, 31, 17, 24, 37, 20, 21, 30, 49, 34, 13, 27, 22, 38, 32, 33, 23, 28, 25, 76, 79, 41, 42, 29, 36, 26, 48, 97, 66, 40, 53, 56, 57, 46, 39, 60, 121, 63, 43, 44, 45, 68, 139, 47, 71, 98, 77, 52, 157, 106, 83, 169, 58, 35, 59
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
COMMENTS
|
Sequence is a permutation of the positive integers.
Cycles (including fixed points) with elements <= 200000 are (1), (2), (3), (4), (5,6,7,9,8), (10), (12,19,17,15), (72), (94,123,113,103), (160,314,521,1867,2677,1003,882,762,528,633,312,207), (400,457,646), (5096,8269,10609,9322), (93388,100549).
|
|
LINKS
|
|
|
EXAMPLE
|
n = 11, prime(11)+1 = 32, numbers not occurring up to a(10) are 11, 12, 13, 14, 15, 16, 17, ... . The smallest one that divides 32 is 16, hence a(11) = 16.
|
|
PROG
|
(PARI) {m=71; w=vectorsmall(3*m); for(n=1, m, k=1; while(w[k]||(prime(n)+1)%k>0, k++); print1(k, ", "); w[k]=1)}
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|