[go: up one dir, main page]

login
A352111
In the factorial base expansion of n, replace each place value, say k! with k > 0, by (-1)^(k-1) * k!.
2
0, 1, -2, -1, -4, -3, 6, 7, 4, 5, 2, 3, 12, 13, 10, 11, 8, 9, 18, 19, 16, 17, 14, 15, -24, -23, -26, -25, -28, -27, -18, -17, -20, -19, -22, -21, -12, -11, -14, -13, -16, -15, -6, -5, -8, -7, -10, -9, -48, -47, -50, -49, -52, -51, -42, -41, -44, -43, -46, -45
OFFSET
0,3
COMMENTS
This sequence maps natural numbers uniquely onto integers.
EXAMPLE
For n = 42:
- 42 = 1 * 4! + 3 * 3! + 0 * 2! + 0 * 1!,
- so a(42) = 1 * -4! + 3 * 3! + 0 * -2! + 0 * 1! = -6.
PROG
(PARI) a(n) = { my (f=1, v=0); for (r=2, oo, if (n, v+=f*(n%r); n\=r; f*=-r, return (v))) }
CROSSREFS
See A053985, A065369, A073835, A352112 for similar sequences.
Sequence in context: A328654 A035552 A339372 * A352112 A114862 A064579
KEYWORD
sign,base
AUTHOR
Rémy Sigrist, Mar 05 2022
STATUS
approved