cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A266295 2-free tetranacci sequence beginning 1,3,5,7.

This page as a plain text file.
%I A266295 #21 Mar 19 2023 13:36:18
%S A266295 1,3,5,7,1,1,7,1,5,7,5,9,13,17,11,25,33,43,7,27,55,33,61,11,5,55,33,
%T A266295 13,53,77,11,77,109,137,167,245,329,439,295,327,695,439,439,475,1,677,
%U A266295 199,169,523,49,235,61,217,281,397,239,567,371,787
%N A266295 2-free tetranacci sequence beginning 1,3,5,7.
%C A266295 For n>4, a(n) = (a(n-1) + a(n-2) + a(n-3) + a(n-4)) / 2^d, where 2^d is the largest power of 2 dividing a(n-1) + a(n-2) + a(n-3) + a(n-4). In other words, sum the previous four terms, then divide by two until the result is odd.
%D A266295 Alm, Herald, Miller, and Sexton, 2-Free Tetranacci Sequences, unpublished.
%H A266295 Jeremy F. Alm, <a href="/A266295/b266295.txt">Table of n, a(n) for n = 1..10000</a>
%F A266295 a(n) = (a(n-1) + a(n-2) + a(n-3) + a(n-4)) / 2^d, where 2^d is the largest power of 2 dividing a(n-1) + a(n-2) + a(n-3) + a(n-4).
%F A266295 a(n) = A000265(a(n-1) + a(n-2) + a(n-3) + a(n-4)). - _Michel Marcus_, Dec 29 2015
%t A266295 nxt[{a_, b_, c_, d_}] := {b, c, d, (a + b + c + d)/2^IntegerExponent[ a + b + c + d, 2]}; NestList[nxt,{1,3,5,7},60][[All,1]] (* _Harvey P. Dale_, Nov 09 2020 *)
%o A266295 (Python)
%o A266295 ### CREATES A b-FILE ###
%o A266295 def main():
%o A266295     name = "b266295.txt"
%o A266295     file = open(name, 'w')
%o A266295     file.write('1' + ' ' + '1\n')
%o A266295     file.write('2' + ' ' + '3\n')
%o A266295     file.write('3' + ' ' + '5\n')
%o A266295     file.write('4' + ' ' + '7\n')
%o A266295     a, b, c, d = 1, 3, 5, 7
%o A266295     for i in range(5,10001):
%o A266295         x=a+b+c+d
%o A266295         while x%2==0:
%o A266295             x /= 2
%o A266295         a, b, c, d = b, c, d, x
%o A266295         file.write(str(i) + ' ' + str(int(d)) + '\n')
%o A266295     file.close()
%o A266295 main()
%o A266295 (PARI) lista(nn) = {print1(x = 1, ", "); print1(y = 3, ", "); print1(z = 5, ", "); print1(t = 7, ", "); for (n=5, nn, tt = (x+y+z+t); tt /= 2^valuation(tt, 2); print1(tt, ", "); x=y; y=z; z=t; t=tt;);} \\ _Michel Marcus_, Dec 29 2015
%Y A266295 Cf. A000265, A232666, A233248, A233526.
%K A266295 nonn
%O A266295 1,2
%A A266295 _Jeremy F. Alm_, Dec 28 2015