cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A348354 The base-5 expansion of a(n) is obtained by replacing 1's, 2's, 3's and 4's by 3's, 4's, 1's and 2's, respectively, in the base-5 expansion of n.

This page as a plain text file.
%I A348354 #12 Oct 18 2021 01:38:47
%S A348354 0,3,4,1,2,15,18,19,16,17,20,23,24,21,22,5,8,9,6,7,10,13,14,11,12,75,
%T A348354 78,79,76,77,90,93,94,91,92,95,98,99,96,97,80,83,84,81,82,85,88,89,86,
%U A348354 87,100,103,104,101,102,115,118,119,116,117,120,123,124,121
%N A348354 The base-5 expansion of a(n) is obtained by replacing 1's, 2's, 3's and 4's by 3's, 4's, 1's and 2's, respectively, in the base-5 expansion of n.
%C A348354 This sequence is a self-inverse permutation of the nonnegative integers.
%C A348354 It is possible to build a similar sequence for any fixed base b > 1 and any permutation p of {1, ..., b-1}.
%C A348354 This sequence is interesting as it satisfies f(a(n)) = -f(n), where f(n) = (A316657(n), A316658(n)).
%H A348354 Rémy Sigrist, <a href="/A348354/b348354.txt">Table of n, a(n) for n = 0..3124</a>
%H A348354 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>
%F A348354 A316657(n) + A316657(a(n)) = 0.
%F A348354 A316658(n) + A316658(a(n)) = 0.
%e A348354 The first terms, in decimal and in base 5, are:
%e A348354   n   a(n)  q(n)  q(a(n))
%e A348354   --  ----  ----  -------
%e A348354    0     0     0        0
%e A348354    1     3     1        3
%e A348354    2     4     2        4
%e A348354    3     1     3        1
%e A348354    4     2     4        2
%e A348354    5    15    10       30
%e A348354    6    18    11       33
%e A348354    7    19    12       34
%e A348354    8    16    13       31
%e A348354    9    17    14       32
%e A348354   10    20    20       40
%t A348354 a[n_] := With[{d = {0, 3, 4, 1, 2}}, FromDigits[d[[IntegerDigits[n, 5] + 1]], 5]]; Array[a, 64, 0] (* _Amiram Eldar_, Oct 16 2021 *)
%o A348354 (PARI) a(n, p=[3,4,1,2]) = fromdigits(apply(d -> if (d, p[d], 0), digits(n, #p+1)), #p+1)
%Y A348354 See A004488, A048647 and A348355 for similar sequences.
%Y A348354 Cf. A316657, A316658.
%K A348354 nonn,base,easy
%O A348354 0,2
%A A348354 _Rémy Sigrist_, Oct 14 2021