login
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.
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
OFFSET
0,2
COMMENTS
This sequence is a self-inverse 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, ..., b-1}.
This sequence is interesting as it satisfies f(a(n)) = -f(n), where f(n) = (A334492(n), A334493(n)).
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
See A004488, A048647 and A348354 for similar sequences.
Sequence in context: A077061 A072508 A075566 * A076087 A082486 A106591
KEYWORD
nonn,base,easy
AUTHOR
Rémy Sigrist, Oct 14 2021
STATUS
approved