%I #13 Oct 26 2019 09:58:26
%S 0,1,2,3,4,5,6,7,8,9,10,11,18,19,20,21,22,23,12,13,14,15,16,17,24,25,
%T 26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,48,49,50,51,52,53,42,
%U 43,44,45,46,47,54,55,56,57,58,59,120,121,122,123,124,125
%N In primorial base: a(n) is obtained by replacing each nonzero digit of n with its inverse (see Comments for precise definition).
%C For a number n >= 0, let d_k, ..., d_0 be the digits of n in primorial base (n = Sum_{i=0..k} d_i * A002110(i), and for i=0..k, 0 <= d_i < prime(i+1)); the digits of a(n) in primorial base, say e_k, ..., e_0, satisfy: for i=0..k:
%C - if d_i = 0, then e_i = 0,
%C - if d_i > 0, then e_i is the inverse of d_i mod prime(i+1) (in other words, 1 <= e_i < prime(i+1) and e_i * d_i = 1 mod prime(i+1)).
%C This sequence is a self-inverse permutation of the nonnegative numbers.
%C a(n) < A002110(k) iff n < A002110(k) for any n >= 0 and k >= 0.
%C a(n) = n iff the digits of n in primorial base, say d_k, ..., d_0, satisfy: for i=0..k: d_i = 0, 1 or prime(i+1)-1.
%C For k > 0: the plotting of the first A002110(k) terms can be obtained by arranging prime(k) copies of the plotting of the first A002110(k-1) terms in a prime(k) X prime(k) grid:
%C - one copy in the cell at position (0,0),
%C - one copy in any cell at position (i,j) with i*j = 1 mod prime(k) (with 0 < i < prime(k) and 0 < j < prime(k)).
%H Rémy Sigrist, <a href="/A289234/b289234.txt">Table of n, a(n) for n = 0..30029</a>
%H Rémy Sigrist, <a href="/A289234/a289234.png">Scatterplot of the first 510510 (=17#) terms</a>
%H <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>
%H <a href="/index/Pri#primorialbase">Index entries for sequences related to primorial base</a>
%F a(n) = A276085(A328617(A276086(n))). - _Antti Karttunen_, Oct 26 2019
%e The digits of 7772 in primorial base are 3,4,0,0,1,0.
%e Also:
%e - 9 * 3 = 27 = 1 mod prime(6) = 13,
%e - 3 * 4 = 12 = 1 mod prime(5) = 11,
%e - 1 * 1 = 1 mod prime(2) = 3.
%e Hence, the digits of a(7772) in primorial base are 9,3,0,0,1,0,
%e and a(7772) = 9 * 11# + 3 * 7# + 1 * 2# = 21422.
%o (PARI) a(n) = my (pr=1, p=2, v=0); while (n>0, my (d=n%p); if (d>0, v += pr * lift(1/Mod(d,p))); pr *= p; n \= p; p = next prime(p+1)); return (v)
%Y Cf. A002110, A049345, A276085, A276086, A328617.
%Y Cf. also A231716, A328622, A328623, A328625, A328626.
%K nonn,base
%O 0,3
%A _Rémy Sigrist_, Jun 28 2017
|