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.

A050045 a(n) = a(n-1) + a(m) for n >= 4, where m = 2^(p+1) + 2 - n and p is the unique integer such that 2^p < n - 1 <= 2^(p+1), starting with a(1) = 1 and a(2) = a(3) = 2.

This page as a plain text file.
%I A050045 #19 Nov 15 2019 03:29:50
%S A050045 1,2,2,4,5,9,11,13,14,27,38,47,52,56,58,60,61,121,179,235,287,334,372,
%T A050045 399,413,426,437,446,451,455,457,459,460,919,1376,1831,2282,2728,3165,
%U A050045 3591,4004,4403,4775,5109,5396,5631,5810,5931
%N A050045 a(n) = a(n-1) + a(m) for n >= 4, where m = 2^(p+1) + 2 - n and p is the unique integer such that 2^p < n - 1 <= 2^(p+1), starting with a(1) = 1 and a(2) = a(3) = 2.
%H A050045 Ivan Neretin, <a href="/A050045/b050045.txt">Table of n, a(n) for n = 1..8193</a>
%p A050045 a := proc(n) option remember;
%p A050045 `if`(n < 4, [1, 2, 2][n], a(n - 1) + a(2^ceil(log[2](n - 1)) + 2 - n)):
%p A050045 end proc:
%p A050045 seq(a(n), n = 1..60); # _Petros Hadjicostas_, Nov 14 2019
%t A050045 Fold[Append[#1, #1[[-1]] + #1[[#2]]] &, {1, 2, 2}, Flatten@Table[k, {n, 5}, {k, 2^n, 1, -1}]] (* _Ivan Neretin_, Sep 07 2015 *)
%Y A050045 Cf. similar sequences with different initial conditions: A050025 (1,1,1), A050029 (1,1,2), A050033 (1,1,3), A050037 (1,1,4), A050041 (1,2,1), A050049 (1,2,3), A050053 (1,2,4), A050057 (1,3,1), A050061 (1,3,2), A050065 (1,3,3), A050069 (1,3,4).
%K A050045 nonn
%O A050045 1,2
%A A050045 _Clark Kimberling_
%E A050045 Name edited by _Petros Hadjicostas_, Nov 14 2019