OFFSET
1,2
LINKS
Matematico Fresnillense, Formulas para extraer digitos de un numero natural permutando
FORMULA
row(n) = floor(n mod (10^(floor(log_10(n)) + 1 - x))), for n>=1 and x=0..floor(log_10(n)).
EXAMPLE
1298 results in {1298, 298, 98, 8}.
Table begins:
1;
2;
3;
4;
5;
6;
7;
8;
9;
10, 0;
11, 1;
12, 2;
...
100, 0, 0;
101, 1, 1;
...
MATHEMATICA
Table[Floor[Mod[n, (10^(Floor[Log[10, n] + 1] - x))]], {n, 1, 30}, {x, 0, Floor[Log[10, n]]}]
f[n_, x_] := Floor[ Mod[ n, (10^(Floor[ Log[10, n] + 1] - x))]]; Table[ f[n, x], {n, 50}, {x, 0, Floor[ Log[10, n]]}] // Flatten (* Robert G. Wilson v, Jul 28 2015 *)
CROSSREFS
KEYWORD
nonn,base,tabf
AUTHOR
José de Jesús Camacho Medina, Jun 26 2015
STATUS
approved