A348355 The base-7 expansion of a(n) is obtained by replacing 1's, 2's, 3's, 4's, 5's and 6's by 4's, 5's, 6's, 1's, 2's and 3's, respectively, in the base-7 expansion of n.
0, 4, 5, 6, 1, 2, 3, 28, 32, 33, 34, 29, 30, 31, 35, 39, 40, 41, 36, 37, 38, 42, 46, 47, 48, 43, 44, 45, 7, 11, 12, 13, 8, 9, 10, 14, 18, 19, 20, 15, 16, 17, 21, 25, 26, 27, 22, 23, 24, 196, 200, 201, 202, 197, 198, 199, 224, 228, 229, 230, 225, 226, 227, 231
Offset: 0
Examples
The first terms, in decimal and in base 7, are: n a(n) s(n) s(a(n)) -- ---- ---- ------- 0 0 0 0 1 4 1 4 2 5 2 5 3 6 3 6 4 1 4 1 5 2 5 2 6 3 6 3 7 28 10 40 8 32 11 44 9 33 12 45 10 34 13 46
Links
Programs
-
Mathematica
a[n_] := With[{d = {0, 4, 5, 6, 1, 2, 3}}, FromDigits[d[[IntegerDigits[n, 7] + 1]], 7]]; Array[a, 64, 0] (* Amiram Eldar, Oct 16 2021 *)
-
PARI
a(n, p=[4,5,6,1,2,3]) = fromdigits(apply(d -> if (d, p[d], 0), digits(n, #p+1)), #p+1)
Comments