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.

Showing 1-3 of 3 results.

A049914 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), starting with a(1) = 1, a(2) = 2 and a(3) = 4.

Original entry on oeis.org

1, 2, 4, 6, 11, 23, 45, 88, 174, 353, 705, 1408, 2814, 5623, 11234, 22446, 44849, 89785, 179569, 359136, 718270, 1436535, 2873058, 5746094, 11492145, 22984204, 45968229, 91936106, 183871509, 367741612, 735480415, 1470955219
Offset: 1

Views

Author

Keywords

Crossrefs

Cf. A049915 (similar, but with minus a(2*m)), A049962 (similar, but with plus a(m)), A049963 (similar, but with plus a(2*m)).

Programs

  • PARI
    lista(nn) = { my(va = vector(nn)); va[1] = 1; va[2] = 2; va[3] = 4; my(sa = vecsum(va)); for (n=4, nn, va[n] = sa - va[n - 1 - 2^ceil(-1 + log(n-1)/log(2))]; sa += va[n]; ); va; } \\ Petros Hadjicostas, Apr 26 2020 (with nn > 2).

Extensions

Name edited by Petros Hadjicostas, Apr 26 2020

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

Original entry on oeis.org

1, 2, 4, 5, 7, 17, 31, 50, 67, 182, 361, 710, 1387, 2642, 4756, 7580, 10222, 28022, 56041, 112070, 224107, 448082, 895636, 1789340, 3573742, 7127042, 14170036, 28004060, 54666862, 103996022, 187115026, 298238090, 402234112
Offset: 1

Views

Author

Keywords

Crossrefs

Cf. A049914 (similar, but with minus a(m/2)), A049962 (similar, but with plus a(m/2)), A049963 (similar, but with plus a(m)).

Programs

  • PARI
    lista(nn) = { my(va = vector(nn)); va[1] = 1; va[2] = 2; va[3] = 4; my(sa = vecsum(va)); for (n=4, nn, va[n] = sa - va[2*n - 2 - 2^ceil(log(n-1)/log(2))]; sa += va[n]; ); va; } \\ Petros Hadjicostas, Apr 26 2020 (with nn > 2)

Extensions

Name edited by Petros Hadjicostas, Apr 26 2020

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

Original entry on oeis.org

1, 2, 4, 9, 25, 43, 93, 220, 617, 1016, 2039, 4112, 8401, 17598, 38292, 90070, 252612, 415156, 830319, 1660672, 3321521, 6643838, 13290772, 26595030, 53262532, 106850150, 214945816, 434874798, 889700788, 1859656696
Offset: 1

Views

Author

Keywords

Comments

The number m in the definition of the sequence equals 2*n - 2 - x, where x is the smallest power of 2 >= n-1. It turns out that m = 1 + A006257(n-2), where the sequence b(n) = A006257(n) satisfies b(2*n) = 2*b(n) - 1 and b(2*n + 1) = 2*b(n) + 1, and it is related to the so-called Josephus problem. - Petros Hadjicostas, Sep 25 2019

Examples

			From _Petros Hadjicostas_, Sep 25 2019: (Start)
a(4) = a(1 + A006257(4-2)) + a(1) + a(2) + a(3) = a(2) + a(1) + a(2) + a(3) = 9.
a(7) = a(1 + A006257(7-2)) + a(1) + a(2) + a(3) + a(4) + a(5) + a(6) = a(4) + a(1) + a(2) + a(3) + a(4) + a(5) + a(6) = 93.
(End)
		

Crossrefs

Cf. A049914 (similar, but with minus a(m/2)), A049915 (similar, but with minus a(m)), A049962 (similar, but with plus a(m/2)).

Programs

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

Formula

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

Extensions

Name edited by Petros Hadjicostas, Sep 25 2019
Showing 1-3 of 3 results.