[go: up one dir, main page]

login
A125521
a(n) is the minimal difference between two distinct n-digit numbers with property that when one of them is typed into a calculator and rotated 180 degrees, the other one is seen.
1
3, 6, 30, 60, 300, 600, 3000, 6000, 30000, 60000, 300000, 600000, 3000000, 6000000, 30000000, 60000000, 300000000, 600000000, 3000000000, 6000000000, 30000000000, 60000000000, 300000000000, 600000000000, 3000000000000, 6000000000000, 30000000000000, 60000000000000, 300000000000000
OFFSET
1,1
FORMULA
If n is even, a(n) is 6 followed by (n - 2) / 2 zeros. If n is odd, a(n) is 3 followed by (n - 1) / 2 zeros.
So a(n) = 3 * 10^(floor(n-1)/2) * 2^(1 - n (mod 2)).
From David A. Corneth, Aug 05 2020: (Start)
a(n) = 10*a(n - 2) for n > 2.
G.f.: (3*x + 6*x^2)/(1 - 10*x^2). (End)
EXAMPLE
a(3) = 30. If one types 595 into a calculator and rotates it 180 degrees, they will get 565. 595 - 565 = 30. With a little thought, it is provable that 30 is the smallest possible difference.
MATHEMATICA
LinearRecurrence[{0, 10}, {3, 6}, 30] (* Amiram Eldar, Aug 05 2020 *)
PROG
(PARI) first(n) = my(res = List([3, 6])); for(i = #res + 1, n, listput(res, 10*res[#res-1])); res \\ David A. Corneth, Aug 05 2020
CROSSREFS
Cf. A125520 (maximal difference).
Sequence in context: A136939 A136944 A136946 * A211168 A355989 A215294
KEYWORD
nonn,easy,base
AUTHOR
Tanya Khovanova and Sergei Bernstein, Dec 29 2006
STATUS
approved