login
In primorial base: a(n) is obtained by replacing each nonzero digit of n with its product with the nonzero digits at lower indices (See Comments for precise definition).
7

%I #18 Feb 27 2020 22:47:52

%S 0,1,2,3,4,5,6,7,8,9,16,17,12,13,14,15,28,29,18,19,20,21,10,11,24,25,

%T 26,27,22,23,30,31,32,33,64,65,36,37,38,39,76,77,72,73,74,75,148,149,

%U 108,109,110,111,190,191,144,145,146,147,52,53,60,61,62,63

%N In primorial base: a(n) is obtained by replacing each nonzero digit of n with its product with the nonzero digits at lower indices (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 == Product_{j=0..i and d_j > 0} d_j (mod prime(i+1)).

%C This sequence is a permutation of the nonnegative integers with inverse A305463.

%C The fixed points of this sequence (A305462) correspond to the numbers with all digits, except possibly the leading digit, equal to zero or one in primorial base.

%C Like A289234, this sequence preserves the number of digits and the number of nonzero digits in primorial base.

%C For any prime number p:

%C - we can build an analog of this sequence, say f_p, for the base p,

%C - in particular, f_2 = A001477,

%C - f_p is a permutation of the nonnegative integers,

%C - f_p preserves the number of digits and the number of nonzero digits in base p,

%C - the fixed points of f_p correspond to the numbers with all digits, except possibly the leading digit, equal to zero or one in base p.

%H Rémy Sigrist, <a href="/A305458/b305458.txt">Table of n, a(n) for n = 0..2310</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 A235224(a(n)) = A235224(n).

%F A267263(a(n)) = A267263(n).

%e The digits of 7772 in primorial base are 3,4,0,0,1,0.

%e Also:

%e - 1 == 1 (mod prime(2)),

%e - 4 * 1 == 4 (mod prime(5)),

%e - 3 * 4 * 1 == 12 (mod prime(6)).

%e Hence the digits of a(7772) in primorial base are 12,4,0,0,1,0, and a(7772) = 28562.

%o (PARI) a(n) = my (v=0, k=1, r=2, p=1); while (n, my (d=n % r); if (d, k *= d; v += p * lift(Mod(k, r))); n \= r; p *= r; r = nextprime(r+1)); return (v)

%Y Cf. A001477, A002110, A049345, A235224, A267263, A289234, A305462 (fixed points), A305463 (inverse).

%K nonn,base

%O 0,3

%A _Rémy Sigrist_, Jun 01 2018