login
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
1, 2, 7, 8, 9, 10, 11, 20, 25, 29, 32, 35, 37, 39, 41, 43, 45, 47, 49, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101
OFFSET
1,2
COMMENTS
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.
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.
Example:
b(1) = 5,
b(2) = 5+floor(10/5) = 7,
b(3) = 7+floor(10/7) = 8, which is a(4) in the original sequence.
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.
Example:
c(1) = -1,
c(2) = -1+ceiling(1/-1) = -2,
c(3) = -2+ceiling(10/-2) = -7, which is the negative of a(3) in the original sequence.
Also,
d(1) = -5,
d(2) = -5+ceiling(10/-5) = -7,
d(3) = -7+ceiling(10/-7) = -8, which is the negative of a(4) in the original sequence.
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 1..10000
FORMULA
a(n) + 1 <= a(n+1) <= a(n) + 9, hence n <= a(n) <= 9n. - Charles R Greathouse IV, Jun 18 2015
EXAMPLE
a(1) = 1;
a(2) = 1 + floor(10^0/a(1)) = 2 with a(1) = 10^0;
a(3) = 2 + floor(10/a(2)) = 7 with 1 < a(2) < 10;
...
a(7) = 10 + floor(10/a(6)) = 11 with a(6) = 10;
a(8) = 11 + floor(10^2/a(7)) = 20 with 10 < a(7) < 10^2.
MATHEMATICA
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 *)
PROG
(C)
// Input: a(n), Output: a(n+1)
int A253251 (int a) {
int t=1, r=0;
while (t/a==0) {
t*=10;
}
r=t/a;
return r+a;
}
(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
CROSSREFS
Sequence in context: A346309 A043054 A107225 * A093915 A152769 A283565
KEYWORD
nonn
AUTHOR
STATUS
approved