login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Inverse permutation to sequence A132988.
4

%I #6 Mar 30 2012 17:27:54

%S 1,2,3,4,8,5,6,9,7,10,14,15,27,13,17,11,19,16,12,22,23,29,33,20,35,42,

%T 28,34,40,24,18,31,32,26,70,41,21,30,51,46,38,39,55,56,57,50,60,43,25,

%U 87,97,64,47,83,85,48,49,69,71,52,93,84,54,76,77,45,79,58,144,81,61,72

%N Inverse permutation to sequence A132988.

%H Klaus Brockhaus, <a href="/A132989/b132989.txt">Table of n, a(n) for n = 1..10000</a>

%H <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>

%e A132988(11) = 16, hence a(16) = 11; A132988(15) = 12, hence a(12) = 15.

%o (PARI) {m=150; v=vector(m); w=vectorsmall(4*m); for(n=1, m, k=1; while(w[k]||(prime(n)+1)%k>0, k++); v[n]=k; w[k]=1); u=vector(m); for(j=1, m, a=v[j]; if(0<a&&a<=m, u[a]=j)); j=1; while(j<=m&&u[j]>0, print1(u[j], ","); j++)}

%Y Cf. A132988.

%K nonn

%O 1,2

%A _Klaus Brockhaus_, Sep 14 2007