login
Rearrangement of positive integers according to decimal expansions of Pi and e (see comments).
2

%I #11 Mar 21 2015 10:43:50

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

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

%U 51,53,55,50,57,59,61,52,63,65,67,69,71,54,73,75,77,56,58,79,81,83,85

%N Rearrangement of positive integers according to decimal expansions of Pi and e (see comments).

%C Take decimal expansions of Pi and e:

%C p = 3,1,4,1,5,9,2,6,5,3,5,8,9,...(A000796) and

%C e = 2,7,1,8,2,8,1,8,2,8,4,5,9,...(A001113).

%C If p(n) > e(n), then a(n) is the next even number; otherwise, a(n) is the next odd number.

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

%t p = RealDigits[Pi, 10, 100][[1]]; e = RealDigits[E, 10, 100][[1]]; r = Range[100]; a[n_] := a[n] = Block[{c = Complement[r, Table[ a[i], {i, n - 1}]]}, If[p[[n]] > e[[n]], Select[c, EvenQ[ # ] &][[1]], Select[c, OddQ[ # ] &][[1]]]]; Table[ a[n], {n, 72}] (* _Robert G. Wilson v_, Apr 02 2005 *)

%Y Cf. A105362.

%K nonn,base

%O 1,1

%A _Zak Seidov_, Apr 01 2005

%E Edited by _Robert G. Wilson v_, Apr 02 2005