A243845 Numbers generated by recursive procedure a(n) = nozero(a(n-1) * 3), in which the function nozero(x) removes all zeros from x, starting with a(1) = 1.
1, 3, 9, 27, 81, 243, 729, 2187, 6561, 19683, 5949, 17847, 53541, 16623, 49869, 14967, 4491, 13473, 4419, 13257, 39771, 119313, 357939, 173817, 521451, 1564353, 469359, 14877, 44631, 133893, 41679, 12537, 37611, 112833, 338499, 115497, 346491, 139473, 418419
Offset: 1
Examples
a(2) = nozero(3*a(1)) = nozero(3) = 3.
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).
Programs
-
Mathematica
NestList[FromDigits@ DeleteCases[IntegerDigits[3 #], ?(# == 0 &)] &, 1, 38] (* _Michael De Vlieger, Jun 27 2020 *)
-
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
Formula
a(n) = A004719(a(n-1) * 3) for n>1, a(1) = 1.
Extensions
Edited: Name, comments and formula reformulated. - Wolfdieter Lang, Jul 13 2014
Comments