cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A178049 The number of iterations of the map x -> x + d(x) to reach a repdigit (cf. A010785), starting at n, where the decimals of d(x) are the first differences of the decimals of x.

This page as a plain text file.
%I A178049 #10 Mar 12 2015 22:50:37
%S A178049 2,1,7,6,7,5,3,6,8,4,2,2,1,5,4,7,3,3,6,8,2,2,2,1,5,4,7,3,3,6,2,2,2,2,
%T A178049 1,5,4,3,3,3,2,2,2,2,2,1,5,4,3,3,2,2,2,2,2,2,1,4,3,3,2,2,2,2,2,2,2,1,
%U A178049 4,3,2,2,2,2,2,2,2,2,1,3,2,2,2,2,2,2,2
%N A178049 The number of iterations of the map x -> x + d(x) to reach a repdigit (cf. A010785), starting at n, where the decimals of d(x) are the first differences of the decimals of x.
%C A178049 Let the recurrence X(k+1) = X(k) + Y(k) with the initial values : X(0) = n, and {x(1), x(2),...,x(p) } is the decimal expansion of n ; Y(0) has the decimal expansion {y(2), y(3),...,y(p)} where y(i) = abs(x(i)- x(i-1)), i = 2,..., p. For n > = 10, a(n) is the number of iterations of Y(k) needed to reach 0.
%C A178049 According to the computations with the Maple program for big numbers, the recurrence converges. Y(k) tends towards zero after a number of finite iterations, and X(k) tends towards a number q with the decimal expansion {p,p, ...,p }.
%H A178049 Michel Lagneau, <a href="/A178049/b178049.txt">Table of n, a(n) for n = 10..10000</a>
%e A178049 a(11) = 1 because 11 + (1-1) = 11 + 0, and 0 is obtained after the first iteration.
%e A178049 a(12) = 7 because 12 + 1 = 13 -> 13 + 2 = 15 -> 15 + 4= 19 -> 19 + 8 = 27-> 27 + 5 = 32 -> 32 + 1 = 33 -> 33 + 0 = 33 is the last number of the cycle, and 0 is obtained after the 7th iteration.
%p A178049 for n from 10 to 200 do:n0:=n:s:=1:for i from 1 to 10^6 while(s<>0) do:x:=convert(n0,base,10):n1:=nops(x):s:=sum(abs(x[j+1]-x[j]),j=1..n1-1):n0:=n0+s:it:=i:od: printf(`%d, `, it):od:
%Y A178049 Cf. A010785.
%K A178049 nonn,base
%O A178049 10,1
%A A178049 _Michel Lagneau_, May 18 2010