function dgpad_repere(x_min, x_max, y_min, y_max) { var fen_x = 2*me.C.coordsSystem.px(0); var fen_y = 2*me.C.coordsSystem.py(0); var coef_x = fen_x/(x_max-x_min); var coef_y = fen_y/(y_max-y_min); if (coef_x>coef_y) { x_min = x_min + 0.5*(x_max-x_min-(y_max-y_min)*fen_x/fen_y); SetCoords(-x_min*coef_y, y_max*coef_y, coef_y); } else { y_max = y_max - 0.5*(y_max-y_min-(x_max-x_min)*fen_y/fen_x); SetCoords(-x_min*coef_x, y_max*coef_x, coef_x); } SetCoordsStyle('isAxis:true;isGrid:true'); } Expression('u0', 'u0 : ', '1', '100', '15', -1, 1); Expression('n', 'n : ', '1', '100', '40', -1, -3); dgpad_repere(-20,520,-20,200); Expression('exp_'+'', '', '', '', "function sommeChiffres(x) { som = 0; while (x > 0) { quotient = Math.floor(x / 10); reste = x % 10; som = som + Math.pow(reste, 2); x = quotient; } return som; } listePoints = []; u = (u0); listePoints.push([0, u]); for (k = 1; k <= (n); k++) { u = sommeChiffres(u); listePoints.push([5 * k, u]); };" + "listePoints", '', ''); List('list_'+'', 'exp_'+''); STL('exp_'+'','h:1'); STL('list_'+'','sg:1'); me.f('u0').setIncrement(1); me.f('n').setIncrement(1);