

A348355


The base7 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 base7 expansion of n.


2



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
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

0,2


COMMENTS

This sequence is a selfinverse permutation of the nonnegative integers.
It is possible to build a similar sequence for any fixed base b > 1 and any permutation p of {1, ..., b1}.
This sequence is interesting as it satisfies f(a(n)) = f(n), where f(n) = (A334492(n), A334493(n)).


LINKS



EXAMPLE

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


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 *)


PROG

(PARI) a(n, p=[4, 5, 6, 1, 2, 3]) = fromdigits(apply(d > if (d, p[d], 0), digits(n, #p+1)), #p+1)


CROSSREFS



KEYWORD

nonn,base,easy


AUTHOR



STATUS

approved



