A101202
Multiples of 142857.
Original entry on oeis.org
142857, 285714, 428571, 571428, 714285, 857142, 999999, 1142856, 1285713, 1428570, 1571427, 1714284, 1857141, 1999998, 2142855, 2285712, 2428569, 2571426, 2714283, 2857140, 2999997, 3142854, 3285711, 3428568, 3571425, 3714282, 3857139, 3999996, 4142853, 4285710
Offset: 1
- Maurice Kraitchik, Mathematical Recreations, New York, Dover (2nd. ed.) 1953, p. 75-76.
- David Wells, The Penguin Dictionary of Curious and Interesting Numbers. Penguin Books, NY, 1986, Revised edition 1987. See entry 142857 at pp. 179-183.
A175417
Exponent of 2 minus sum of all other exponents, in the prime power factorization of n!
Original entry on oeis.org
0, 0, 1, 0, 2, 1, 1, 0, 3, 1, 1, 0, 1, 0, 0, -2, 2, 1, 0, -1, 0, -2, -2, -3, -1, -3, -3, -6, -5, -6, -7, -8, -3, -5, -5, -7, -7, -8, -8, -10, -8, -9, -10, -11, -10, -13, -13, -14, -11, -13, -14, -16, -15, -16, -18, -20, -18, -20, -20, -21, -21, -22, -22, -25, -19, -21, -22
Offset: 0
a(20) = 0 because 20! = 2432902008176640000 = ((2^18)*(3^8)*(5^4)*(7^2)*(11^1)*(13^1)*(17^1)*(19^1)) and 18-(8+4+2+1+1+1+1) = 0.
-
f:= proc(n) local t,p,k;
p:= 2: t:= add(floor(n/2^k),k=1..ilog2(n)):
do
p:= nextprime(p);
if n < p then return t fi;
t:= t - add(floor(n/p^k),k=1..ilog[p](n))
od
end proc:
map(f, [$0..100]); # Robert Israel, Nov 10 2024
-
Table[2*IntegerExponent[m!,2]-Total[Last/@FactorInteger[m! ]],{m,0,130}]
A381886
Triangle read by rows: T(n, k) = Sum_{j=1..floor(log[k](n))} floor(n / k^j) if k >= 2, T(n, 1) = n, T(n, 0) = 0^n.
Original entry on oeis.org
1, 0, 1, 0, 2, 1, 0, 3, 1, 1, 0, 4, 3, 1, 1, 0, 5, 3, 1, 1, 1, 0, 6, 4, 2, 1, 1, 1, 0, 7, 4, 2, 1, 1, 1, 1, 0, 8, 7, 2, 2, 1, 1, 1, 1, 0, 9, 7, 4, 2, 1, 1, 1, 1, 1, 0, 10, 8, 4, 2, 2, 1, 1, 1, 1, 1, 0, 11, 8, 4, 2, 2, 1, 1, 1, 1, 1, 1, 0, 12, 10, 5, 3, 2, 2, 1, 1, 1, 1, 1, 1
Offset: 0
Triangle starts:
[ 0] 1;
[ 1] 0, 1;
[ 2] 0, 2, 1;
[ 3] 0, 3, 1, 1;
[ 4] 0, 4, 3, 1, 1;
[ 5] 0, 5, 3, 1, 1, 1;
[ 6] 0, 6, 4, 2, 1, 1, 1;
[ 7] 0, 7, 4, 2, 1, 1, 1, 1;
[ 8] 0, 8, 7, 2, 2, 1, 1, 1, 1;
[ 9] 0, 9, 7, 4, 2, 1, 1, 1, 1, 1;
[10] 0, 10, 8, 4, 2, 2, 1, 1, 1, 1, 1;
[11] 0, 11, 8, 4, 2, 2, 1, 1, 1, 1, 1, 1;
[12] 0, 12, 10, 5, 3, 2, 2, 1, 1, 1, 1, 1, 1;
-
T := (n, b) -> local i; ifelse(b = 0, b^n, ifelse(b = 1, n, add(iquo(n, b^i), i = 1..floor(log(n, b))))): seq(seq(T(n, b), b = 0..n), n = 0..12);
# Alternative:
T := (n, k) -> local j; ifelse(k = 0, k^n, ifelse(k = 1, n, add(padic:-ordp(j, k), j = 1..n))): for n from 0 to 12 do seq(T(n, k), k = 0..n) od;
-
T[n_, 0] := If[n == 0, 1, 0]; T[n_, 1] := n;
T[n_, k_] := Last@Accumulate[IntegerExponent[Range[n], k]];
Table[T[n, k], {n, 0, 12}, {k, 0, n}] // MatrixForm
(* Alternative: *)
T[n_, k_] := Sum[Floor[n/k^j], {j, Floor[Log[k, n]]}]; T[n_, 1] := n; T[n_, 0] := 0^n; T[0, 0] = 1; Flatten@ Table[T[n, k], {n, 0, 12}, {k, 0, n}] (* Michael De Vlieger, Apr 03 2025 *)
-
T(n,k) = if (n==0, 1, if (n==1, k, if (k==0, 0, if (k==1, n, sum(j=1, n, valuation(j, k))))));
row(n) = vector(n+1, k, T(n,k-1)); \\ Michel Marcus, Apr 04 2025
-
from math import log
def T(n: int, b: int) -> int:
return (b**n if b == 0 else n if b == 1 else
sum(n // (b**i) for i in range(1, 1 + int(log(n, b)))))
print([[T(n, b) for b in range(n+1)] for n in range(12)])
-
def T(n, b): return (b^n if b == 0 else n if b == 1 else sum(valuation(j, b) for j in (1..n)))
print(flatten([[T(n, b) for b in range(n+1)] for n in srange(13)]))
Comments