T.R | Title | User | Personal Name | Date | Lines |
---|
558.1 | first three maybe ... | THEBUS::KOSTAS | Wisdom is the child of experience. | Thu Aug 07 1986 14:22 | 12 |
|
re. .0
is this a good?
FACTORIAL(20)/2^20; RESULT = 2320196173824.00
FACTORIAL(24)/2^24; RESULT = 36981609743777792.00
FACTORIAL(33)/2^33; RESULT = 1010871318849578446046101504.00
/Kostas
|
558.2 | losing twos | GALLO::JMUNZER | | Thu Aug 07 1986 14:41 | 11 |
| I don't understand .0. Isn't
20! = 20 * 19 * 18 * 17 * 16 * 15 * 14 * 13 * 12 * 11 * 10
* 9 * 8 * 7 * 6 * 5 * 4 * 3 * 2 * 1
= 2^2 * odd * 2^1 * odd * 2^4 * odd * 2^1 * odd * 2^2 * odd * 2^1
* odd * 2^3 * odd * 2^1 * odd * 2^2 * odd * 2^1 * odd
= 2^18 * odd
?
John
|
558.3 | Oops. 16+2=20 is the source of the errors. | CLT::GILBERT | eager like a child | Thu Aug 07 1986 15:02 | 2 |
| n
Do we ever have: n! = 2 x (2m+1)?
|
558.4 | | GALLO::JMUNZER | | Thu Aug 07 1986 15:23 | 13 |
| It seems to me that
# of powers of two in n!
+ # of bits in n
------------------------
= n
E.g. 0 1 1 3 3 4 4 7
1 1 2 1 2 2 3 1
- - - - - - - -
1 2 3 4 5 6 7 8
John
|
558.5 | | CLT::GILBERT | eager like a child | Thu Aug 07 1986 15:52 | 1 |
| How about exponents of the 3 in the factorization?
|
558.6 | | GALLO::JMUNZER | | Thu Aug 07 1986 18:54 | 6 |
| re .5: if T(n) = # of threes in n!
and D(n) = sum of digits of n when expressed in ternary
then T(n) + T(n) + D(n) = n
John
|
558.7 | | CLT::GILBERT | eager like a child | Fri Aug 08 1986 01:05 | 6 |
| In general(?),
if T(n) = # of k's in n!
and D(n) = sum of digits of n when expressed in base k
then (k-1) * T(n) + D(n) = n
|
558.8 | It's more general than that | MODEL::YARBROUGH | | Fri Aug 22 1986 16:56 | 15 |
| If p is prime, the exponent of p in n! is
oo
-----
\ n
> [-----]
/ p^k
-----
k=i
where [x] is the largest integer in x. Thus the exponent of
2 in 20! is [20/2]+[20/4]+[20/8]+[20/16]+... = 10+5+2+1 = 18.
If p is composite, the exponent of p in n! is the least of the exponents
of the prime factors of p.
|
558.9 | | GALLO::JMUNZER | | Fri Aug 22 1986 17:35 | 28 |
| Sketch of an inductive proof that
(k-1) * T(n) + D(n) = n & T(n) = S(n),
where T and D are defined in .7 and S is defined in .8:
Suppose n, in base k, ends with X digits equal to k-1:
(d)(d)...(d)(d)(e)(k-1)(k-1)...(k-1)(k-1)
Then when
n ---> n+1
(d)(d)...(d)(d)(e)(k-1)(k-1)...(k-1)(k-1) --->
(d)(d)...(d)(d)(e+1)(0)(0)...(0)(0)
and
T(n+1) = T(n) + X
D(n+1) = D(n) - X * (k-1) + 1
(k-1) * T(n+1) + D(n+1) = (k-1) * T(n) + (k-1) * X + D(n)
- X * (k-1) + 1
= (k-1) * T(n) + D(n) + 1
= n + 1
and also
[n+1 / k^j] = [n / k^j] + 1 for every j <= X,
so
S(n+1) = S(n) + X = T(n) + X = T(n+1)
John
|