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.

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

Original entry on oeis.org

1, 3, 4, 9, 20, 38, 78, 157, 319, 630, 1262, 2525, 5055, 10121, 20260, 40560, 81199, 162242, 324486, 648973, 1297951, 2595913, 5191844, 10383728, 20767535, 41535232, 83070775, 166142182, 332285627, 664573784, 1329152634, 2658315407, 5316651114, 10633261669, 21266523340, 42533046681, 85066093367, 170132186745
Offset: 1

Views

Author

Keywords

Examples

			From _Petros Hadjicostas_, Sep 27 2019: (Start)
a(4) = a(4-1-2^ceiling(-1 + log_2(4-1))) + a(1) + a(2) + a(3) = a(1) + a(1) + a(2) + a(3) = 9.
a(5) = a(5-1-2^ceiling(-1 + log_2(5-1))) + a(1) + a(2) + a(3) + a(4) = a(2) + a(1) + a(2) + a(3) + a(4) = 20.
a(6) = a(6-1-2^ceiling(-1 + log_2(6-1))) + a(1) + a(2) + a(3) + a(4) + a(5) = a(1) + a(1) + a(2) + a(3) + a(4) + a(5) = 38.
(End)
		

Crossrefs

Programs

  • Maple
    a := proc(n) local i; option remember; if n < 4 then return [1, 3, 4][n]; end if; add(a(i), i = 1 .. n - 1) + a(n - 3/2 - 1/2*Bits:-Iff(n - 2, n - 2)); end proc;
    seq(a(n), n = 1 .. 37); # Petros Hadjicostas, Sep 27 2019 using a modification of a program by Peter Luschny

Formula

a(n) = a(n - 1 - 2^ceiling(-1 + log_2(n-1))) + Sum_{i = 1..n-1} a(i) = a((1 + A006257(n-2))/2) + Sum_{i = 1..n-1} a(i) for n >= 4 with a(1) = 1, a(2) = 3, and a(3) = 4. - Petros Hadjicostas, Sep 27 2019

Extensions

Name edited by and more terms from Petros Hadjicostas, Sep 27 2019