login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Working in base 5: a(0)=0, thereafter a(n+1) is the smallest number not already in the sequence such that the bits of a(n) and a(n+1) together can be rearranged to form a palindrome.
7

%I #7 Nov 16 2013 14:15:28

%S 0,11,1,10,100,12,2,20,101,22,3,13,31,103,30,110,33,4,14,41,104,40,

%T 114,24,42,112,21,102,120,201,210,1000,111,44,113,23,32,121,200,211,

%U 222,233,244,323,332,424,442,1001,122,133,144,212,221,313,331,414,441,1002,123

%N Working in base 5: a(0)=0, thereafter a(n+1) is the smallest number not already in the sequence such that the bits of a(n) and a(n+1) together can be rearranged to form a palindrome.

%C This is a permutation of the nonnegative integers in base 5 - see the Comments in A228407 for the proof.

%t a[0] = 0; a[n_] := a[n] = Block[{k = 1, idm = IntegerDigits[ a[n - 1], 5], t = a@# & /@ Range[n - 1]}, Label[ start]; While[ MemberQ[t, k], k++]; While[ Select[ Permutations[ Join[ idm, IntegerDigits[k, 5]]], #[[1]] != 0 && # == Reverse@# &] == {}, k++; Goto[ start]]; k]; s = Array[a, 60, 0]; FromDigits@# & /@ IntegerDigits[s, 5]

%Y Cf. A230891, A231920, A231922, A231926, A231928, A231930, A231932, A228407, A231925.

%K nonn,base,easy

%O 0,2

%A _N. J. A. Sloane_ and _Robert G. Wilson v_, Nov 15 2013