%I #21 Jun 01 2018 08:16:07
%S 2,22,212,2122,21222,212212,2122112,21221112,212211122,2122111222,
%T 21221112212,212211122122,2122111221212,21221112212112,
%U 212211122121122,2122111221211222,21221112212112212,212211122121122122
%N a(n) is the largest integer with n digits in base 3/2.
%C Every number starts and ends with 2 and contains only twos and ones.
%C Removing the last digit produces sequence A304272 of the largest even integers in base 3/2.
%C The value of this sequence in base 10 is A304025.
%C When adding 1 to the value of this sequence we get A070885.
%C The largest integer with a given number of digits in base 3/2 can be produced directly from the smallest number, sequence A304023, by replacing 21 at the beginning and 0 at the end with 2, and by shifting the rest up by 1, see sequence A304023.
%F a(1) = 2, for n > 1, a(n) = 10 * a(n - 1) + 2 if A304025(n - 1) is even. Otherwise, a(n) = 10 * a(n - 1) - 8. - _David A. Corneth_, May 11 2018
%e The number 5 in base 3/2 is 22, and the number 6 is 210. Therefore, 22 is the largest two-digit integer.
%o (PARI) first(n) = {my(res=vector(n), c = 2); res[1]=2; for(i=2, n, res[i] = 10 * res[i-1] + 2; if(c % 2 == 1, res[i] -= 10); c = 3 * c / 2 + if(c%2==0, 2, 1/2)); res} \\ _David A. Corneth_, May 11 2018
%Y Cf. A005428, A024629, A070885, A073941, A081848, A246435, A303500, A304023, A304025, A304272.
%K nonn,base,easy
%O 0,1
%A _Tanya Khovanova_ and PRIMES STEP Senior group, May 04 2018