OFFSET
0,2
COMMENTS
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
Rémy Sigrist, Oct 14 2021
STATUS
approved