login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A253251 a(1) = 1, and for n > 0, a(n+1) = a(n) + floor(10^k/a(n)), where k is the least integer such that 10^k >= a(n). 1

%I #36 Sep 30 2015 04:34:42

%S 1,2,7,8,9,10,11,20,25,29,32,35,37,39,41,43,45,47,49,51,52,53,54,55,

%T 56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,

%U 79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101

%N a(1) = 1, and for n > 0, a(n+1) = a(n) + floor(10^k/a(n)), where k is the least integer such that 10^k >= a(n).

%C a(1) = 1 is the first number in the sequence because it is the first positive integer that has a reciprocal, whereas zero has no definite result (infinity) for its reciprocal.

%C If any other positive integer is used as a(1) (for example, a(1) = 5), the resulting terms will follow the original sequence after a few cycles of adding and flooring.

%C Example:

%C b(1) = 5,

%C b(2) = 5+floor(10/5) = 7,

%C b(3) = 7+floor(10/7) = 8, which is a(4) in the original sequence.

%C Also, if any negative integer is used as a(1) (and the condition is adjusted to -1 <= ceiling(10^k/a(n-1) < -10), the same happens, except that the resulting terms will be negative.

%C Example:

%C c(1) = -1,

%C c(2) = -1+ceiling(1/-1) = -2,

%C c(3) = -2+ceiling(10/-2) = -7, which is the negative of a(3) in the original sequence.

%C Also,

%C d(1) = -5,

%C d(2) = -5+ceiling(10/-5) = -7,

%C d(3) = -7+ceiling(10/-7) = -8, which is the negative of a(4) in the original sequence.

%H Charles R Greathouse IV, <a href="/A253251/b253251.txt">Table of n, a(n) for n = 1..10000</a>

%F a(n) + 1 <= a(n+1) <= a(n) + 9, hence n <= a(n) <= 9n. - _Charles R Greathouse IV_, Jun 18 2015

%e a(1) = 1;

%e a(2) = 1 + floor(10^0/a(1)) = 2 with a(1) = 10^0;

%e a(3) = 2 + floor(10/a(2)) = 7 with 1 < a(2) < 10;

%e ...

%e a(7) = 10 + floor(10/a(6)) = 11 with a(6) = 10;

%e a(8) = 11 + floor(10^2/a(7)) = 20 with 10 < a(7) < 10^2.

%t f[n_] := Block[{a = {1}, i, k}, For[i = 2, i <= n, i++, k = 0; While[10^k < a[[i - 1]], k++]; AppendTo[a, a[[i - 1]] + Floor[10^k/a[[i - 1]]]]]; a]; f@ 70 (* _Michael De Vlieger_, Jun 19 2015 *)

%o (C)

%o // Input: a(n), Output: a(n+1)

%o int A253251 (int a) {

%o int t=1, r=0;

%o while (t/a==0) {

%o t*=10;

%o }

%o r=t/a;

%o return r+a;

%o }

%o (PARI) first(n)=my(v=vector(n,i,1),N=1,k=1);for(i=2,n,if(k>N,N*=10);v[i]=k+=N\k);v \\ _Charles R Greathouse IV_, Jun 18 2015

%K nonn

%O 1,2

%A _Arlu Genesis A. Padilla_, Jun 05 2015

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 24 19:06 EDT 2024. Contains 371962 sequences. (Running on oeis4.)