login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A083569 Smallest m not occurring earlier such that m+n is prime. 5

%I #17 Apr 11 2015 15:10:18

%S 1,3,2,7,6,5,4,9,8,13,12,11,10,15,14,21,20,19,18,17,16,25,24,23,22,27,

%T 26,31,30,29,28,35,34,33,32,37,36,41,40,39,38,47,46,45,44,43,42,49,48,

%U 51,50,55,54,53,52,57,56,69,68,67,66,65,64,63,62,61,60,59,58,79,78,77

%N Smallest m not occurring earlier such that m+n is prime.

%C a(a(n))=n: a self-inverse permutation with A010051(a(n)+n)=1. - _Reinhard Zumkeller_, Nov 25 2004

%H Paul Tek, <a href="/A083569/b083569.txt">Table of n, a(n) for n = 1..1000</a>

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

%o (PARI) A083569(n)={global(a083569);type(a083569)=="t_VEC"||a083569=vector(n); #a083569<n&&a083569=concat(a083569,vector(n-#a083569));my(u=[0]); a083569[n]||for(i=1,n, a083569[i]||for(k=u[1]+1,9e9, !setsearch(u,k)&&isprime(i+k)&&(a083569[i]=k)&&break);u=setunion(u,[a083569[i]]); while(#u>1&&u[2]==u[1]+1,u=u[2..-1]));a083569[n]} \\ Returns the n-th term and defines the global array a083569 up to that value at least. For efficiency it is better to (pre)compute a large number of terms at once (via A083569(N_max)) rather than one after the other. - _M. F. Hasler_, Apr 11 2015

%Y Cf. A084721.

%Y Cf. A071065.

%K nonn

%O 1,2

%A _Amarnath Murthy_, Jun 12 2003

%E More terms from _David Wasserman_, Nov 19 2004

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 7 00:25 EDT 2024. Contains 372298 sequences. (Running on oeis4.)