|
|
A305458
|
|
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
|
|
|
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, 26, 27, 22, 23, 30, 31, 32, 33, 64, 65, 36, 37, 38, 39, 76, 77, 72, 73, 74, 75, 148, 149, 108, 109, 110, 111, 190, 191, 144, 145, 146, 147, 52, 53, 60, 61, 62, 63
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,3
|
|
COMMENTS
|
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:
- if d_i = 0, then e_i = 0,
- if d_i > 0, then e_i == Product_{j=0..i and d_j > 0} d_j (mod prime(i+1)).
This sequence is a permutation of the nonnegative integers with inverse A305463.
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.
Like A289234, this sequence preserves the number of digits and the number of nonzero digits in primorial base.
For any prime number p:
- we can build an analog of this sequence, say f_p, for the base p,
- f_p is a permutation of the nonnegative integers,
- f_p preserves the number of digits and the number of nonzero digits in base p,
- 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.
|
|
LINKS
|
|
|
FORMULA
|
|
|
EXAMPLE
|
The digits of 7772 in primorial base are 3,4,0,0,1,0.
Also:
- 1 == 1 (mod prime(2)),
- 4 * 1 == 4 (mod prime(5)),
- 3 * 4 * 1 == 12 (mod prime(6)).
Hence the digits of a(7772) in primorial base are 12,4,0,0,1,0, and a(7772) = 28562.
|
|
PROG
|
(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)
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|