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.

A049922 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) = 3 and a(3) = 2.

Original entry on oeis.org

1, 3, 2, 5, 8, 18, 34, 69, 135, 274, 546, 1093, 2183, 4363, 8716, 17416, 34797, 69662, 139322, 278645, 557287, 1114571, 2229132, 4458248, 8916461, 17832856, 35665573, 71330874, 142661201, 285321312, 570640444, 1141276535, 2282544370
Offset: 1

Views

Author

Keywords

Crossrefs

Cf. A049923 (similar, but with minus a(2*m)), A049970 (similar, but with plus a(m)), A049971 (similar, but with plus a(2*m)).

Programs

  • PARI
    lista(nn) = { my(va = vector(nn)); va[1] = 1; va[2] = 3; va[3] = 2; 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

A049923 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) = 3, and a(3) = 2.

Original entry on oeis.org

1, 3, 2, 3, 6, 12, 24, 39, 51, 138, 276, 543, 1059, 2019, 3633, 5790, 7809, 21405, 42810, 85611, 171195, 342291, 684177, 1366878, 2729985, 5444355, 10824504, 21392328, 41760069, 79442661, 142937349, 227824365, 307267026, 842358414
Offset: 1

Views

Author

Keywords

Crossrefs

Cf. A049922 (similar, but with minus a(m/2)), A049970 (similar, but with plus a(m/2)), A049971 (similar, but with plus a(m)).

Programs

  • PARI
    lista(nn) = { my(va = vector(nn)); va[1] = 1; va[2] = 3; va[3] = 2; 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

A049970 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) = 3, and a(3) = 2.

Original entry on oeis.org

1, 3, 2, 7, 16, 30, 62, 123, 251, 496, 994, 1987, 3979, 7967, 15948, 31928, 63917, 127712, 255426, 510851, 1021707, 2043423, 4086860, 8173752, 16347565, 32695258, 65390761, 130782020, 261565033, 523132058, 1046268104, 2092544189
Offset: 1

Views

Author

Keywords

Crossrefs

Cf. A049922 (similar, but with minus a(m)), A049923 (similar, but with minus a(2*m)), A049971 (similar, but with plus a(2*m)).

Programs

  • Mathematica
    a[1] = 1; a[2] = 3; a[3] = 2; a[n_] := a[n] = Sum[a[k], {k, 1, n - 1}] + a[n - 1 - 2^Floor[Log[2, n - 2]]]; Table[a[n], {n, 1, 32}] (* Vaclav Kotesovec, Apr 26 2020 *)
  • PARI
    lista(nn) = { my(va = vector(nn)); va[1] = 1; va[2] = 3; va[3] = 2; 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)

Formula

a(n) ~ c * 2^n, where c = 0.487208413167251561410300158795277398357249626073353318217181284278722123325... - Vaclav Kotesovec, Apr 26 2020

Extensions

Name edited by Petros Hadjicostas, Apr 25 2020
Showing 1-3 of 3 results.