OFFSET
1,1
LINKS
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
KEYWORD
nonn,easy,base
AUTHOR
Tanya Khovanova and Sergei Bernstein, Dec 29 2006
STATUS
approved