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.

A257801 Permutation of natural numbers: a(1)=1; a(oddprime(n)) = lucky(1+a(n)), a(not_an_oddprime(n)) = unlucky(a(n-1)).

This page as a plain text file.
%I A257801 #13 May 10 2015 11:01:01
%S A257801 1,2,3,4,7,5,9,6,11,8,13,14,25,10,17,12,15,19,33,20,35,16,21,24,18,22,
%T A257801 27,45,43,28,31,47,23,29,34,26,51,30,38,59,63,57,115,39,42,61,37,32,
%U A257801 40,46,36,66,73,41,52,78,83,76,49,146,67,53,56,81,50,44,79,54,60,48,163,86,87,95,55,68,101,107,171,98,64
%N A257801 Permutation of natural numbers: a(1)=1; a(oddprime(n)) = lucky(1+a(n)), a(not_an_oddprime(n)) = unlucky(a(n-1)).
%C A257801 Here lucky(n) = n-th lucky number = A000959(n), unlucky(n) = n-th unlucky number = A050505(n), oddprime(n) = n-th odd prime = A065091(n), not_an_oddprime(n) = n-th natural number which is not an odd prime = A065090(n).
%H A257801 Antti Karttunen, <a href="/A257801/b257801.txt">Table of n, a(n) for n = 1..10000</a>
%H A257801 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>
%F A257801 a(1) = 1; a(2) = 2; if A010051(n) = 1 [i.e., when n is an (odd) prime] then a(n) = A000959(1+a(A000720(n)-1)), otherwise a(n) = A050505(a(A062298(n))).
%F A257801 As a composition of other permutations:
%F A257801 a(n) = A257726(A257727(n)).
%F A257801 a(n) = A257731(A257730(n)).
%o A257801 (Scheme, with memoizing definec-macro)
%o A257801 (definec (A257801 n) (cond ((<= n 2) n) ((= 1 (A010051 n)) (A000959 (+ 1 (A257801 (+ -1 (A000720 n)))))) (else (A050505 (A257801 (A062298 n))))))
%o A257801 ;; Alternatively, by composing other permutations:
%o A257801 (define (A257801 n) (A257726 (A257727 n)))
%Y A257801 Inverse: A257802.
%Y A257801 Cf. A000959, A000720, A010051, A050505, A062298, A065090, A065091.
%Y A257801 Related or similar permutations: A257726, A257727, A257730, A257731.
%K A257801 nonn
%O A257801 1,2
%A A257801 _Antti Karttunen_, May 09 2015