A371916 Zeroless analog of tetranacci numbers.
1, 1, 1, 1, 4, 7, 13, 25, 49, 94, 181, 349, 673, 1297, 25, 2344, 4339, 85, 6793, 13561, 24778, 45217, 9349, 9295, 88639, 1525, 1888, 11347, 13399, 28159, 54793, 17698, 11449, 11299, 95239, 135685, 253672, 495895, 98491, 983743, 183181, 176131, 1441546, 278461, 279319, 2175457
Offset: 0
Examples
a(14) = Zr(a(13)+a(12)+a(11)+a(10)) = Zr(1297+673+349+181) = Zr(2500) = 25.
Programs
-
Mathematica
a[0]=a[1]=a[2]=a[3]=1; a[n_]:=FromDigits[DeleteCases[IntegerDigits[a[n-1]+a[n-2]+a[n-3]+a[n-4]], 0]]; Array[a, 46, 0] (* Stefano Spezia, Apr 12 2024 *)
-
Python
def a(n): a, b, c, d = 1, 1, 1, 1 for _ in range(n): a, b, c, d = b, c, d, int(str(a+b+c+d).replace('0', '')) return a
-
Python
# faster for initial segment of sequence from itertools import islice def agen(): # generator of terms a, b, c, d = 1, 1, 1, 1 while True: yield a a, b, c, d = b, c, d, int(str(a+b+c+d).replace("0", "")) print(list(islice(agen(), 45))) # Michael S. Branicky, Apr 13 2024
Formula
a(n) = Zr(a(n-1)+a(n-2)+a(n-3)+a(n-4)), where the function Zr(k) removes zero digits from k.
Comments