login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

a(n) = if n<6 then n else 6*a(floor(n/6)) + 5 - n mod 6.
9

%I #13 Aug 17 2024 23:14:12

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

%T 26,25,24,35,34,33,32,31,30,71,70,69,68,67,66,65,64,63,62,61,60,59,58,

%U 57,56,55,54,53,52,51,50,49,48,47,46,45,44,43,42,41,40,39,38,37,36,107

%N a(n) = if n<6 then n else 6*a(floor(n/6)) + 5 - n mod 6.

%C Self-inverse permutation of the natural numbers;

%C if n is written in base 6 representation, then a(n) is the value after replacing all digits d (but not the leading one) by 5-d.

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

%F a(n) = A115310(n+4, 5).

%t a[n_]:=If[n<6,n,6*a[Floor[n/6]]+5-Mod[n,6]];Table[a[n],{n,72}] (* _James C. McMahon_, Aug 11 2024 *)

%Y Cf. A054429, A115303, A115304, A115305, A115307, A115308, A115309, A106649.

%K nonn,base,easy

%O 1,2

%A _Reinhard Zumkeller_, Jan 20 2006