OFFSET
1,2
COMMENTS
Sequence is a permutation of the positive integers.
Cycles (including fixed points) with elements <= 260000 are (1), (2), (3,4), (5), (6), (7,8,9,11,10), (12), (14), (17,29,27), (24,44), (33,34,46), (38,54,50), (56,131,82,60), (181), (201,307,1013,2686,1608,1236,839,462,545,982,860,556,335,225,713,901,700,377,259,409,467,474,280,362,305), (1542,1619,1956), (6459), (6466), (10297,18037,25086), (15525,28383,82429,43930,59038,122233,43666), (18181,25301), (58503,90771), (100362), (251732).
a(n) is the position of the n-th prime number in A139317: A139317(a(n)) = A000040(n). See les-mathematiques.net link. - Alain Rousseau, Oct 04 2023
LINKS
Klaus Brockhaus, Table of n, a(n) for n = 1..10000
les-mathematiques.net, Les suites A139317 & A132948
EXAMPLE
n = 9, prime(9)-1 = 22, numbers not occurring up to a(8) are 7, 9, 10, 11, 12, ... . The smallest one that divides 22 is 11, hence a(9) = 11.
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
Klaus Brockhaus, Sep 14 2007
STATUS
approved