cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A257730 Permutation of natural numbers: a(1)=1; a(oddprime(n)) = prime(a(n)), a(not_an_oddprime(n)) = composite(a(n-1)).

This page as a plain text file.
%I A257730 #13 May 10 2015 10:59:59
%S A257730 1,4,2,9,7,6,3,16,14,12,23,8,17,26,24,21,13,35,5,15,27,39,53,36,33,22,
%T A257730 51,10,43,25,37,40,56,75,52,49,83,34,72,18,19,62,59,38,54,57,101,78,
%U A257730 102,74,69,114,89,50,98,28,30,86,73,82,41,55,76,80,134,106,149,135,100,94,11,150,47,120,70,130,42,45,103,117,99,112,167,58,77
%N A257730 Permutation of natural numbers: a(1)=1; a(oddprime(n)) = prime(a(n)), a(not_an_oddprime(n)) = composite(a(n-1)).
%C A257730 Here composite(n) = n-th composite = A002808(n), prime(n) = n-th prime = A000040(n), oddprime(n) = n-th odd prime = A065091(n) = A000040(n+1), not_an_oddprime(n) = n-th natural number which is not an odd prime = A065090(n).
%H A257730 Antti Karttunen, <a href="/A257730/b257730.txt">Table of n, a(n) for n = 1..10000</a>
%H A257730 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>
%F A257730 a(1) = 1; if A000035(n) = 1 and A010051(n) = 1 [i.e., when n is an odd prime], then a(n) = A000040(a(A000720(n)-1)), otherwise a(n) = A002808(a(A062298(n))). [Here A062298(n) gives the index of n among numbers larger than 1 which are not odd primes, 1 for 2, 2 for 4, 3 for 6, etc.]
%F A257730 As a composition of other permutations:
%F A257730 a(n) = A246378(A257727(n)).
%F A257730 a(n) = A257732(A257801(n)).
%o A257730 (Scheme, with memoizing definec-macro)
%o A257730 (definec (A257730 n) (cond ((<= n 1) n) ((and (odd? n) (= 1 (A010051 n))) (A000040 (A257730 (+ -1 (A000720 n))))) (else (A002808 (A257730 (A062298 n))))))
%o A257730 ;; Alternatively, by composing other permutations:
%o A257730 (define (A257730 n) (A246378 (A257727 n)))
%Y A257730 Inverse: A257729.
%Y A257730 Cf. A000040, A000720, A002808, A010051, A062298, A065090, A065091.
%Y A257730 Related or similar permutations: A246378, A257727, A257732, A257801, A236854.
%K A257730 nonn
%O A257730 1,2
%A A257730 _Antti Karttunen_, May 09 2015