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-5 of 5 results.

A206774 First differences of A033922.

Original entry on oeis.org

0, 0, 1, -1, 1, 0, 1, -1, 1, 0, 1, -1, 1, 0, 1, -4, 1, 0, 1, -1, 1, 0, 1, -1, 1, 0, 1, -1, 1, 0, 1, -4, 1, 0, 1, -1, 1, 0, 1, -1, 1, 0, 1, -1, 1, 0, 1, -4, 1, 0, 1, -1, 1, 0, 1, -1, 1, 0, 1, -1, 1, 0, 1, -6, 1, 0, 1, -1, 1, 0, 1, -1, 1, 0, 1, -1, 1, 0, 1, -4, 1, 0, 1, -1, 1, 0, 1, -1, 1, 0, 1, -1, 1, 0, 1, -4, 1, 0, 1, -1, 1, 0, 1, -1, 1
Offset: 1

Views

Author

Benoit Cloitre, Jan 10 2013

Keywords

Crossrefs

Cf. A033922.

Programs

Formula

a(n) = A033922(n) - A033922(n-1).
For n >= 1, a(2n+1)=1, a(4n+2)=0, a(4*A042968(n))=-1, a(16*A042968(n))=-4, a(64*(2n+1))=-6. The values < 0 taken by the sequence are -1,-4,-6,-7, ... see A206775.

Extensions

More terms from Antti Karttunen, Nov 06 2018

A033639 Base-2 digital convolution sequence.

Original entry on oeis.org

1, 1, 1, 2, 1, 2, 3, 6, 1, 3, 4, 13, 4, 11, 21, 49, 13, 17, 24, 62, 66, 103, 145, 338, 128, 297, 376, 1156, 763, 1564, 2592, 6451, 376, 1532, 1139, 4235, 4124, 11714, 8735, 26105, 5263, 21212, 18122, 77153, 35210, 100649, 135748, 369972, 95275, 207638
Offset: 0

Views

Author

Keywords

Examples

			Suppose base = 3 and a(0)..a(13) are 1, 1, 2, 1, 3, 7, 6, 20, 52, 6, 26, 104, 32, 162. In base 3, 14 = 112, so we convolve the last three terms with 1, 1, 2 to obtain 104*1 + 32*1 + 162*2 = 460.
		

Crossrefs

Programs

  • Maple
    a:= proc(n) option remember; `if`(n=0, 1, (l->
          add(l[i]*a(n-i), i=1..nops(l)))(Bits[Split](n)))
        end:
    seq(a(n), n=0..49);  # Alois P. Heinz, Apr 14 2021
  • Mathematica
    a[0] = 1; a[n_] := a[n] = Total[(d = IntegerDigits[n, 2]) * Table[a[n - Length[d] + k - 1], {k, 1, Length[d]}]]; Array[a, 50, 0] (* Amiram Eldar, Jul 25 2023 *)
  • PARI
    See Links section.

A273004 Sum of coefficients in the hereditary representation of n in base 2.

Original entry on oeis.org

0, 1, 2, 3, 3, 4, 5, 6, 4, 5, 6, 7, 7, 8, 9, 10, 4, 5, 6, 7, 7, 8, 9, 10, 8, 9, 10, 11, 11, 12, 13, 14, 5, 6, 7, 8, 8, 9, 10, 11, 9, 10, 11, 12, 12, 13, 14, 15, 9, 10, 11, 12, 12, 13, 14, 15, 13, 14, 15, 16, 16, 17, 18, 19, 6, 7, 8, 9, 9, 10, 11, 12, 10, 11, 12, 13, 13, 14, 15, 16, 10, 11, 12, 13, 13, 14, 15, 16, 14, 15, 16, 17, 17, 18, 19, 20, 11, 12, 13, 14, 14
Offset: 0

Views

Author

M. F. Hasler, May 12 2016

Keywords

Comments

The hereditary representation of a number n in base b is a [possibly empty] sum (possibly represented as a list) of monomials of the form m*b^e (possibly represented as a list [m,e] or as a single number m if e = 0) with coefficients 0 < m < b, and the (strictly increasing) exponents e > 0 recursively again expressed in the same form. Thus 0 = [], 1 = 1*b^0 = [1], b = 1*b^1 = [[1, [1]]] etc.

Examples

			266 = 1*2^1 + 1*2^(1+1*2^1) + 1*2^(1*2^(1+1*2^1)) which can be represented as [[1, [1]], [1, [1, [1, [1]]]], [1, [[1, [1, [1, [1]]]]]]], and there are 11 "1"s, therefore a(266) = 11.
		

Crossrefs

Cf. A056004, A222112, A273005 (base 10 analog), A033922, A361838.

Programs

  • Mathematica
    a[n_] := a[n] = Total[1 + a /@ Log2[DeleteCases[NumberExpand[n, 2], 0]]]; (* Vladimir Reshetnikov, Dec 21 2023 *)
  • PARI
    (hr(n,b=2)=if(1<#n=digits(n,b),my(v=if(n[#n],[n[#n]],[]));forstep(i=#n-1,1,-1,n[i]&&v=concat(v,[[n[i],hr(#n-i,b)]]));v,n));(cc(v)=if(type(v)=="t_VEC",sum(i=1,#v,cc(v[i])),v)); a(n)=cc(hr(n))
    
  • Python
    def A273004(n):
      s=format(n,'b')[::-1]
      return sum(1+A273004(i) for i in range(len(s)) if s[i]=='1') # Pontus von Brömssen, Sep 17 2020

Formula

If n = Sum_{j=1..k} 2^e_j where 0 <= e_1 < ... < e_k, then a(n) = k + Sum_{j=1..k} a(e_j). - Pontus von Brömssen, Sep 17 2020
a(n) = A033922(n) + A361838(floor(n/2)) for n > 1. - Andrei Zabolotskii, Aug 24 2025

A033926 Base 6 digital convolution sequence.

Original entry on oeis.org

1, 1, 2, 3, 4, 5, 1, 2, 3, 4, 5, 6, 2, 3, 4, 5, 6, 7, 3, 4, 5, 6, 7, 8, 4, 5, 6, 7, 8, 9, 5, 6, 7, 8, 9, 10, 2, 3, 4, 5, 6, 7, 3, 4, 5, 6, 7, 8, 4, 5, 6, 7, 8, 9, 5, 6, 7, 8, 9, 10, 6, 7, 8, 9, 10, 11, 7, 8, 9, 10, 11, 12, 4, 5, 6, 7, 8, 9, 5, 6, 7, 8, 9, 10, 6, 7, 8, 9, 10, 11, 7, 8, 9, 10, 11, 12, 8, 9
Offset: 0

Views

Author

Keywords

Examples

			181 = 501 in base 6, so a(181) = 5*a(2)+0*a(1)+1*a(0) = 5*2+0+1 = 11.
		

Crossrefs

Programs

  • Mathematica
    nn = 90; a[0] = 1; Do[k = Total@ MapIndexed[#1 a[First[#2] - 1] &, Reverse@ IntegerDigits[n, 6]]; a[n] = k, {n, nn}]; Array[a, nn + 1, 0] (* Michael De Vlieger, Nov 03 2022 *)
  • PARI
    a(n) = if (n, my(d=digits(n, 6)); sum(k=1, #d, d[k]*a(#d-k)), 1); \\ Michel Marcus, Nov 03 2022

Extensions

Offset 0 from Michel Marcus, Nov 03 2022

A381957 If n = Sum 2^e(k), then a(n) = Sum 2^a(e(k)), with a(0) = 1.

Original entry on oeis.org

1, 2, 4, 6, 16, 18, 20, 22, 64, 66, 68, 70, 80, 82, 84, 86, 65536, 65538, 65540, 65542, 65552, 65554, 65556, 65558, 65600, 65602, 65604, 65606, 65616, 65618, 65620, 65622, 262144, 262146, 262148, 262150, 262160, 262162, 262164, 262166, 262208, 262210, 262212, 262214, 262224, 262226
Offset: 0

Views

Author

Ilya Gutkovskiy, Mar 11 2025

Keywords

Comments

Replace 2^k in the binary representation of n with 2^a(k).

Examples

			25 = 2^4 + 2^3 + 2^0, hence a(25) = 2^a(4) + 2^a(3) + 2^a(0) = 2^16 + 2^6 + 2^1 = 65602.
		

Crossrefs

Programs

  • Mathematica
    e[n_] := -1 + Position[Reverse[IntegerDigits[n, 2]], 1] // Flatten; a[0] = 1; a[n_] := a[n] = Total[2^a /@ e[n]]; Array[a, 50, 0] (* Amiram Eldar, Mar 11 2025 *)
  • PARI
    a(n) = if (n==0, 1, my(v=Vecrev(binary(n))); sum(k=1, #v, if (v[k], 2^a(k-1)))); \\ Michel Marcus, Mar 11 2025

Formula

G.f.: 1 + (1/(1 - x)) * Sum_{k>=0} 2^a(k) * x^(2^k) / (1 + x^(2^k)).
Showing 1-5 of 5 results.