OFFSET
1,2
COMMENTS
Numbers in the following sequence: Let a(1) = 1, then begin the recursive sequence a(n) = nozero(a(n-1) * 3), where the function nozero(x) removes all zeros from x.
The sequence returns standard powers of 3 until step 11, where a(11) = nozero(19683 * 3) = nozero(59049) = 5949.
At step 28, a(28) = nozero(469359 * 3) = nozero(1408077) = 14877. At step 108, a(108) = nozero(4959 * 3) = 14877. Therefore a(28) = a(108) and the sequence repeats. Because this is the first instance where a member of this sequence is repeated one has a(n + L) = a(n) for n >= 28 with the primitive (least) period length L = 108 - 28 = 80.
LINKS
Anthony Sand, Table of n, a(n) for n = 1..108
Index entries for linear recurrences with constant coefficients, signature (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1).
FORMULA
a(n) = A004719(a(n-1) * 3) for n>1, a(1) = 1.
EXAMPLE
a(2) = nozero(3*a(1)) = nozero(3) = 3.
MATHEMATICA
NestList[FromDigits@ DeleteCases[IntegerDigits[3 #], _?(# == 0 &)] &, 1, 38] (* Michael De Vlieger, Jun 27 2020 *)
PROG
(Sage)
L=[1]
for i in [1..108]:
T=(3*L[i-1]).digits(base=10)
TT=filter(lambda a: a != 0, T)
L.append(sum(TTi*10^i for i, TTi in enumerate(TT)))
L # - Tom Edgar, Jun 17 2014
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Anthony Sand, Jun 12 2014
EXTENSIONS
Edited: Name, comments and formula reformulated. - Wolfdieter Lang, Jul 13 2014
STATUS
approved