|
|
A289234
|
|
In primorial base: a(n) is obtained by replacing each nonzero digit of n with its inverse (see Comments for precise definition).
|
|
12
|
|
|
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, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 48, 49, 50, 51, 52, 53, 42, 43, 44, 45, 46, 47, 54, 55, 56, 57, 58, 59, 120, 121, 122, 123, 124, 125
(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 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)).
This sequence is a self-inverse permutation of the nonnegative numbers.
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.
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:
- one copy in the cell at position (0,0),
- 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)).
|
|
LINKS
|
|
|
FORMULA
|
|
|
EXAMPLE
|
The digits of 7772 in primorial base are 3,4,0,0,1,0.
Also:
- 9 * 3 = 27 = 1 mod prime(6) = 13,
- 3 * 4 = 12 = 1 mod prime(5) = 11,
- 1 * 1 = 1 mod prime(2) = 3.
Hence, the digits of a(7772) in primorial base are 9,3,0,0,1,0,
and a(7772) = 9 * 11# + 3 * 7# + 1 * 2# = 21422.
|
|
PROG
|
(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)
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|