The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
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!)
A257731 Permutation of natural numbers: a(1) = 1, a(prime(n)) = lucky(1+a(n)), a(composite(n)) = unlucky(a(n)), where prime(n) = n-th prime number A000040, composite(n) = n-th composite number A002808 and lucky = A000959, unlucky = A050505. 6

%I #12 May 07 2015 11:00:54

%S 1,3,9,2,33,5,7,14,4,45,163,8,15,11,20,6,25,59,63,203,12,22,13,17,28,

%T 10,35,78,235,83,1093,251,18,30,19,24,31,39,16,47,67,101,43,290,107,

%U 1283,87,309,26,41,27,34,21,42,53,23,61,88,115,128,321,57,354,137,1499,112,349,376,36,55,1401,38,49,46,29,56,70,32,99,81

%N Permutation of natural numbers: a(1) = 1, a(prime(n)) = lucky(1+a(n)), a(composite(n)) = unlucky(a(n)), where prime(n) = n-th prime number A000040, composite(n) = n-th composite number A002808 and lucky = A000959, unlucky = A050505.

%H Antti Karttunen, <a href="/A257731/b257731.txt">Table of n, a(n) for n = 1..6185</a>

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

%F a(1) = 1; for n > 1: if A010051(n) = 1 [i.e., if n is a prime], then a(n) = A000959(1+a(A000720(n))), otherwise a(n) = A050505(a(A065855(n))).

%F As a composition of other permutations:

%F a(n) = A257726(A246377(n)).

%F a(n) = A257733(A255421(n)).

%o (Scheme, with memoization-macro definec)

%o (definec (A257731 n) (cond ((= 1 n) n) ((= 1 (A010051 n)) (A000959 (+ 1 (A257731 (A000720 n))))) (else (A050505 (A257731 (A065855 n))))))

%o ;; Alternatively, by composing other permutations:

%o (define (A257731 n) (A257726 (A246377 n)))

%o (define (A257731 n) (A257733 (A255421 n)))

%Y Inverse: A257732.

%Y Cf. A000040, A000720, A000959, A002808, A010051, A050505, A065855.

%Y Related or similar permutations: A246377, A255421, A257726, A257733.

%Y Cf. also A032600, A255553, A255554.

%Y Differs from A257733 for the first time at n=19, where a(19) = 63, while A257733(19) = 203.

%K nonn

%O 1,2

%A _Antti Karttunen_, May 06 2015

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 June 7 22:01 EDT 2024. Contains 373206 sequences. (Running on oeis4.)