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.

A085765 Partial sums and bisection of A086450.

Original entry on oeis.org

1, 2, 4, 5, 9, 11, 16, 17, 26, 30, 41, 43, 59, 64, 81, 82, 108, 117, 147, 151, 192, 203, 246, 248, 307, 323, 387, 392, 473, 490, 572, 573, 681, 707, 824, 833, 980, 1010, 1161, 1165, 1357, 1398, 1601, 1612, 1858, 1901, 2149, 2151, 2458, 2517
Offset: 0

Views

Author

Ralf Stephan, Jul 22 2003

Keywords

Comments

Sum of inverses of a(n) is 1.5398789314089581123...
Conjecture: log(a(n))/log(n) grows unboundedly.
Conjecture: a(n) mod 2 repeats the 7-pattern 0,0,1,1,1,0,1.
The conjecture concerning the mod 2 pattern follows directly from the corresponding conjecture proved in A086450. - Lambert Herrgesell (zero815(AT)googlemail.com), May 08 2007

Programs

  • Maple
    b:= proc(n) local m; b(n):= `if`(n=0, 1,
          `if`(irem(n, 2, 'm')=1, b(m), a(m)))
        end:
    a:= proc(n) a(n):= b(n) +`if`(n=0, 0, a(n-1)) end:
    seq(a(n), n=0..100);  # Alois P. Heinz, Sep 26 2013
  • Mathematica
    b[0] = 1;
    b[n_] := b[n] = If[EvenQ[n], Sum[b[n/2-k], {k, 0, n/2}], b[(n-1)/2]]; A085765 = Table[b[n], {n, 0, 100}] // Accumulate (* Jean-François Alcover, Mar 28 2017 *)
  • PARI
    v=vector(1000);v[1]=1;s=1;for(n=2,1000,v[n]=if(n%2==0,v[n/2],s=s+v[(n+1)/2];print1(s",");s))
    
  • PARI
    lista(nn) = {v=vector(nn); v[1]=1; s=1; for(n = 2, nn, v[n]= if(n%2==0, v[n/2], s=s+v[(n+1)/2])); forstep(i = 1, nn, 2, print1(v[i], ", "););} \\ Michel Marcus, Sep 26 2013

Formula

a(n) = A086450(2n) = A086450(0) + ... + A086450(n). - Charles R Greathouse IV, Sep 26 2013

A086449 a(0) = 1, a(2n+1) = a(n), a(2n) = a(n) + a(n-1) + ... + a(n-2^m) + ... where a(n) = 0 for n < 0.

Original entry on oeis.org

1, 1, 2, 1, 4, 2, 4, 1, 8, 4, 8, 2, 12, 4, 8, 1, 18, 8, 16, 4, 26, 8, 16, 2, 34, 12, 24, 4, 36, 8, 16, 1, 48, 18, 36, 8, 60, 16, 32, 4, 80, 26, 52, 8, 78, 16, 32, 2, 104, 34, 68, 12, 110, 24, 48, 4, 136, 36, 72, 8, 108, 16, 32, 1, 154, 48, 96, 18, 160, 36, 72, 8
Offset: 0

Views

Author

Ralf Stephan, Jul 20 2003

Keywords

Comments

Conjecture: all a(n) are even except a(2^k-1) = 1. Also a(2^k-2) = 2^(k-1). [For proof see link.]
Setting m=0 gives Stern-Brocot sequence (A002487).
a(n) is the number of ways of writing n as a sum of powers of 2, where each power appears p times, with p itself a power of 2.

Examples

			From _Peter Luschny_, Sep 01 2019: (Start)
The sequence splits into rows of length 2^k:
  1
  1,  2
  1,  4, 2,  4
  1,  8, 4,  8, 2, 12, 4,  8
  1, 18, 8, 16, 4, 26, 8, 16, 2, 34, 12, 24, 4, 36, 8, 16
  ...
The first few partitions counted are (compare with the list in A174980):
[ 0]  [[]]
[ 1]  [[1]]
[ 2]  [[2], [1, 1]]
[ 3]  [[2, 1]]
[ 4]  [[4], [2, 2], [2, 1, 1], [1, 1, 1, 1]]
[ 5]  [[4, 1], [2, 2, 1]]
[ 6]  [[4, 2], [4, 1, 1], [2, 2, 1, 1], [2, 1, 1, 1, 1]]
[ 7]  [[4, 2, 1]]
[ 8]  [[8], [4, 4], [4, 2, 2], [4, 2, 1, 1], [4, 1, 1, 1, 1], [2, 2, 2, 2],
      [2, 2, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1]]
[ 9]  [[8, 1], [4, 4, 1], [4, 2, 2, 1], [2, 2, 2, 2, 1]]
[10]  [[8, 2], [8, 1, 1], [4, 4, 2], [4, 4, 1, 1], [4, 2, 2, 1, 1],
      [4, 2, 1, 1, 1, 1], [2, 2, 2, 2, 1, 1], [2, 1, 1, 1, 1, 1, 1, 1, 1]]
[11]  [[8, 2, 1], [4, 4, 2, 1]]
[12]  [[8, 4], [8, 2, 2], [8, 2, 1, 1], [8, 1, 1, 1, 1], [4, 4, 2, 2],
      [4, 4, 2, 1, 1], [4, 4, 1, 1, 1, 1], [4, 2, 2, 2, 2], [4, 2, 2, 1, 1, 1, 1],
      [4, 1, 1, 1, 1, 1, 1, 1, 1], [2, 2, 2, 2, 1, 1, 1, 1],
      [2, 2, 1, 1, 1, 1, 1, 1, 1, 1]]
[13]  [[8, 4, 1], [8, 2, 2, 1], [4, 4, 2, 2, 1], [4, 2, 2, 2, 2, 1]]
[14]  [[8, 4, 2], [8, 4, 1, 1], [8, 2, 2, 1, 1], [8, 2, 1, 1, 1, 1],
      [4, 4, 2, 2, 1, 1], [4, 4, 2, 1, 1, 1, 1], [4, 2, 2, 2, 2, 1, 1],
      [4, 2, 1, 1, 1, 1, 1, 1, 1, 1]]
[15]  [[8, 4, 2, 1]]
(End)
		

Crossrefs

Programs

  • Magma
    m:=80; R:=PowerSeriesRing(Integers(), m); Coefficients(R!( (&*[1 + (&+[x^(2^(k+j)): j in [0..m/4]]): k in [0..m/4]]) )); // G. C. Greubel, Feb 11 2019
  • Maple
    A086449 := proc(n) option remember;
    local IndexSet, k; IndexSet := proc(n) local i, j, z;
    i := iquo(n,2); j := i; if odd::n then i := i-1; z := 1;
    while 0 <= i do j := j,i; i := i-z; z := z+z od fi; j end:
    if n < 2 then 1 else add(A086449(k),k=IndexSet(n)) fi end:
    seq(A086449(i),i=0..71); # Peter Luschny, May 06 2011
    # second Maple program:
    a:= proc(n) option remember; local r; `if`(n=0, 1,
          `if`(irem(n, 2, 'r')=1, a(r),
           a(r) +add(a(r-2^m), m=0..ilog2(r))))
        end:
    seq(a(n), n=0..80);  # Alois P. Heinz, May 30 2014
  • Mathematica
    nn=30;CoefficientList[Series[Product[1+Sum[x^(2^(k+j)),{j,0,nn}],{k,0,nn}],{x,0,nn}],x] (* Geoffrey Critzer, May 30 2014 *)

Formula

G.f.: Product_{k>=0} (1 + Sum_{j>=0} x^(2^(k+j))). [Corrected by Herbert S. Wilf, May 31 2006]

A288310 a(0) = a(1) = 1; a(2*n) = a(n) - a(n-1), a(2*n+1) = Sum_{k=0..n} a(n-k).

Original entry on oeis.org

1, 1, 0, 2, -1, 2, 2, 4, -3, 3, 3, 5, 0, 7, 2, 11, -7, 8, 6, 11, 0, 14, 2, 19, -5, 19, 7, 26, -5, 28, 9, 39, -18, 32, 15, 40, -2, 46, 5, 57, -11, 57, 14, 71, -12, 73, 17, 92, -24, 87, 24, 106, -12, 113, 19, 139, -31, 134, 33, 162, -19, 171, 30, 210, -57, 192, 50, 224, -17, 239, 25
Offset: 0

Views

Author

Ilya Gutkovskiy, Jun 07 2017

Keywords

Comments

Sequence has its first differences and its partial sums as bisections.

Examples

			a(0) = a(1) = 1 by definition;
a(2) = a(2*1) = a(1) - a(0) = 0;
a(3) = a(2*1+1) = a(0) + a(1) = 2;
a(4) = a(2*2) = a(2) - a(1) = -1;
a(5) = a(2*2+1) = a(0) + a(1) + a(2) = 2;
a(6) = a(2*3) = a(3) - a(2) = 2, etc.
		

Crossrefs

Programs

  • Mathematica
    a[0] = 1; a[1] = 1; a[n_] := a[n] = If[EvenQ[n], a[n/2] - a[(n - 2)/2], Sum[a[(n - 1)/2 - k], {k, 0, (n - 1)/2}]]; Table[a[n], {n, 0, 70}]
  • Python
    def a(n): return 1 if n<2 else a(n/2) - a(n/2 - 1) if n%2==0 else sum([a((n - 1)/2 - k) for k in range((n + 1)/2)]) # Indranil Ghosh, Jun 08 2017

Formula

a(n) = Sum_{k=0..n} a(2*k).
a(n) = a(2*n+1) - a(2*n-1).
a(2*n+1) = Sum_{k=0..n} Sum_{m=0..k} a(2*m).
Showing 1-3 of 3 results.