login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A304024
a(n) is the largest integer with n digits in base 3/2.
8
2, 22, 212, 2122, 21222, 212212, 2122112, 21221112, 212211122, 2122111222, 21221112212, 212211122122, 2122111221212, 21221112212112, 212211122121122, 2122111221211222, 21221112212112212, 212211122121122122
OFFSET
0,1
COMMENTS
Every number starts and ends with 2 and contains only twos and ones.
Removing the last digit produces sequence A304272 of the largest even integers in base 3/2.
The value of this sequence in base 10 is A304025.
When adding 1 to the value of this sequence we get A070885.
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.
FORMULA
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
EXAMPLE
The number 5 in base 3/2 is 22, and the number 6 is 210. Therefore, 22 is the largest two-digit integer.
PROG
(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
KEYWORD
nonn,base,easy
AUTHOR
Tanya Khovanova and PRIMES STEP Senior group, May 04 2018
STATUS
approved