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”).

A004665
Powers of 3 written in base 11. (Next term contains a non-decimal character.)
1
1, 3, 9, 25, 74, 201, 603, 1709
OFFSET
0,2
COMMENTS
The next term contains a non-decimal character if such a character (e.g., 'A') is chosen to represent a digit 10, where "digit" means the coefficients in N = Sum_{k>=0} d_k * 11^k. A different "encoding" has to be used to represent such terms in the Data sections of OEIS entries. In order to preserve the terms a(0..7), one could use the two-digit combinations '08' and '18' to encode the digits 8 (the only one not occurring so far) and 10. - M. F. Hasler, Jun 25 2018
MATHEMATICA
FromDigits[IntegerDigits[#, 11]]&/@(3^Range[0, 7]) (* Harvey P. Dale, Jul 31 2013 *)
PROG
(PARI) apply( A004665(n)=if(vecmax(n=digits(3^n, 11))>9, Strchr(apply(d->48+d+(d>9)*7, n)), fromdigits(n)), [0..10]) \\ Slightly shorter but slower: {a(n)=iferr(eval(n=Strchr(apply(d->48+d+(d>9)*7, digits(3^n, 11)))), E, n)}. - M. F. Hasler, Jun 25 2018
CROSSREFS
Sequence in context: A211298 A138574 A101499 * A196431 A244826 A183111
KEYWORD
nonn,base
STATUS
approved