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

A284266 Odd bisection of A277700, binary weight of terms of A283975.

Original entry on oeis.org

1, 2, 1, 3, 2, 3, 1, 4, 3, 3, 2, 3, 3, 4, 1, 5, 4, 3, 3, 2, 1, 3, 2, 3, 3, 4, 3, 3, 4, 5, 1, 6, 5, 3, 4, 3, 3, 2, 3, 3, 2, 3, 1, 4, 3, 3, 2, 3, 3, 4, 3, 3, 2, 3, 3, 4, 3, 5, 4, 3, 5, 6, 1, 7, 6, 3, 5, 4, 3, 3, 4, 5, 3, 2, 3, 5, 2, 3, 3, 4, 3, 3, 2, 5, 3, 4, 1, 5, 2, 3, 3, 6, 3, 3, 2, 3, 3, 4, 3, 5, 2, 3, 3, 2, 1, 3, 2, 5, 3, 4, 3, 5, 4, 5, 3, 4, 3, 3, 4, 5, 3
Offset: 0

Views

Author

Antti Karttunen, Mar 25 2017

Keywords

Crossrefs

Programs

Formula

a(n) = A277700((2*n)+1).
a(n) = A000120(A283975(n)).
Other identities. For all n >= 0:
A007306(1+n) = a(n) + 2*A284265(n).

A125184 Triangle read by rows: T(n,k) is the coefficient of t^k in the Stern polynomial B(n,t) (n>=0, k>=0).

Original entry on oeis.org

0, 1, 0, 1, 1, 1, 0, 0, 1, 1, 2, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 2, 1, 0, 1, 2, 1, 3, 1, 0, 0, 1, 1, 1, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 2, 1, 1, 0, 1, 2, 1, 1, 3, 3, 0, 0, 1, 2, 1, 4, 3, 0, 1, 3, 1, 1, 3, 2, 1, 0, 0, 0, 1, 1, 1, 2, 3, 1, 0, 1, 2, 2, 1, 3, 3, 1, 0, 0, 1, 1, 1, 1, 2, 2, 2, 0, 1, 1, 1
Offset: 0

Views

Author

Emeric Deutsch, Dec 04 2006

Keywords

Comments

The Stern polynomials B(n,t) are defined by B(0,t)=0, B(1,t)=1, B(2n,t)=tB(n,t), B(2n+1,t)=B(n+1,t)+B(n,t) for n>=1 (see S. Klavzar et al.).
Also number of hyperbinary representations of n-1 containing exactly k digits 1. A hyperbinary representation of a nonnegative integer n is a representation of n as a sum of powers of 2, each power being used at most twice. Example: row 9 of the triangle is 1,2,1; indeed the hyperbinary representations of 8 are 200 (2*2^2+0*2^1+0*2^0), 120 (1*2^2+2*2^1+0*2^0), 1000 (1*2^3+0*2^2+0*2^1+0*2^0) and 112 (1*2^2+1*2^1+2*1^0), having 0,1,1 and 2 digits 1, respectively (see S. Klavzar et al. Corollary 3).
Number of terms in row n is A277329(n) (= 1+A057526(n) for n >= 1).
Row sums yield A002487 (Stern's diatomic series).
T(2n+1,1) = A005811(n) = number of 1's in the standard Gray code of n (S. Klavzar et al. Theorem 8). T(4n+1,1)=1, T(4n+3,1)=0 (S. Klavzar et al., Lemma 5).
From Antti Karttunen, Oct 27 2016: (Start)
Number of nonzero terms on row n is A277314(n).
Number of odd terms on row n is A277700(n).
Maximal term on row n is A277315(n).
Product of nonzero terms on row n is A277325(n).
Number of times where row n and n+1 both contain nonzero term in the same position is A277327(n).
(End)

Examples

			Triangle starts:
0;
1;
0, 1;
1, 1;
0, 0, 1;
1, 2;
0, 1, 1;
1, 1, 1;
0, 0, 0, 1;
1, 2, 1;
0, 1, 2;
1, 3, 1;
		

Crossrefs

Cf. A186890 (n such that the Stern polynomial B(n,x) is self-reciprocal).
Cf. A186891 (n such that the Stern polynomial B(n,x) is irreducible).
Cf. A260443 (Stern polynomials encoded in the prime factorization of n).

Programs

  • Maple
    B:=proc(n) if n=0 then 0 elif n=1 then 1 elif n mod 2 = 0 then t*B(n/2) else B((n+1)/2)+B((n-1)/2) fi end: for n from 0 to 36 do B(n):=sort(expand(B(n))) od: dg:=n->degree(B(n)): 0; for n from 0 to 40 do seq(coeff(B(n),t,k),k=0..dg(n)) od; # yields sequence in triangular form
  • Mathematica
    B[0, ] = 0; B[1, ] = 1; B[n_, t_] := B[n, t] = If[EvenQ[n], t*B[n/2, t], B[1 + (n-1)/2, t] + B[(n-1)/2, t]]; row[n_] := CoefficientList[B[n, t], t]; row[0] = {0}; Array[row, 40, 0] // Flatten (* Jean-François Alcover, Jul 30 2015 *)

Extensions

0 prepended by T. D. Noe, Feb 28 2011
Original comment slightly edited by Antti Karttunen, Oct 27 2016

A264977 a(0) = 0, a(1) = 1, a(2*n) = 2*a(n), a(2*n+1) = a(n) XOR a(n+1).

Original entry on oeis.org

0, 1, 2, 3, 4, 1, 6, 7, 8, 5, 2, 7, 12, 1, 14, 15, 16, 13, 10, 7, 4, 5, 14, 11, 24, 13, 2, 15, 28, 1, 30, 31, 32, 29, 26, 7, 20, 13, 14, 3, 8, 1, 10, 11, 28, 5, 22, 19, 48, 21, 26, 15, 4, 13, 30, 19, 56, 29, 2, 31, 60, 1, 62, 63, 64, 61, 58, 7, 52, 29, 14, 19, 40, 25, 26, 3, 28, 13, 6, 11, 16, 9, 2, 11, 20, 1, 22
Offset: 0

Views

Author

Antti Karttunen, Dec 10 2015

Keywords

Comments

a(n) is the n-th Stern polynomial (cf. A260443, A125184) evaluated at X = 2 over the field GF(2).
For n >= 1, a(n) gives the index of the row where n occurs in array A277710.

Examples

			In this example, binary numbers are given zero-padded to four bits.
a(2) = 2a(1) = 2 * 1 = 2.
a(3) = a(1) XOR a(2) = 1 XOR 2 = 0001 XOR 0010 = 0011 = 3.
a(4) = 2a(2) = 2 * 2 = 4.
a(5) = a(2) XOR a(3) = 2 XOR 3 = 0010 XOR 0011 = 0001 = 1.
a(6) = 2a(3) = 2 * 3 = 6.
a(7) = a(3) XOR a(4) = 3 XOR 4 = 0011 XOR 0100 = 0111 = 7.
		

Crossrefs

Cf. A023758 (the fixed points).
Cf. also A068156, A168081, A265407.
Cf. A277700 (binary weight of terms).
Cf. A277701, A277712, A277713 (positions of 1's, 2's and 3's in this sequence).
Cf. A277711 (position of the first occurrence of each n in this sequence).
Cf. also arrays A277710, A099884.

Programs

  • Mathematica
    recurXOR[0] = 0; recurXOR[1] = 1; recurXOR[n_] := recurXOR[n] = If[EvenQ[n], 2recurXOR[n/2], BitXor[recurXOR[(n - 1)/2 + 1], recurXOR[(n - 1)/2]]]; Table[recurXOR[n], {n, 0, 100}] (* Jean-François Alcover, Oct 23 2016 *)
  • Python
    class Memoize:
        def _init_(self, func):
            self.func=func
            self.cache={}
        def _call_(self, arg):
            if arg not in self.cache:
                self.cache[arg] = self.func(arg)
            return self.cache[arg]
    @Memoize
    def a(n): return n if n<2 else 2*a(n//2) if n%2==0 else a((n - 1)//2)^a((n + 1)//2)
    print([a(n) for n in range(51)]) # Indranil Ghosh, Jul 27 2017

Formula

a(0) = 0, a(1) = 1, a(2*n) = 2*a(n), a(2*n+1) = a(n) XOR a(n+1).
a(n) = A248663(A260443(n)).
a(n) = A048675(A277330(n)). - Antti Karttunen, Oct 27 2016
Other identities. For all n >= 0:
a(n) = n - A265397(n).
From Antti Karttunen, Oct 28 2016: (Start)
A000035(a(n)) = A000035(n). [Preserves the parity of n.]
A010873(a(n)) = A010873(n). [a(n) mod 4 = n mod 4.]
A001511(a(n)) = A001511(n) = A055396(A277330(n)). [In general, the 2-adic valuation of n is preserved.]
A010060(a(n)) = A011655(n).
a(n) <= n.
For n >= 2, a((2^n)+1) = (2^n) - 3.
The following two identities are so far unproved:
For n >= 2, a(3*A000225(n)) = a(A068156(n)) = 5.
For n >= 2, a(A068156(n)-2) = A062709(n) = 2^n + 3.
(End)

A278243 Filter-sequence for Stern polynomials: Least number with the same prime signature as A260443(n).

Original entry on oeis.org

1, 2, 2, 6, 2, 12, 6, 30, 2, 60, 12, 120, 6, 180, 30, 210, 2, 420, 60, 1080, 12, 2160, 120, 2520, 6, 2520, 180, 7560, 30, 6300, 210, 2310, 2, 4620, 420, 37800, 60, 90720, 1080, 75600, 12, 226800, 2160, 544320, 120, 453600, 2520, 138600, 6, 138600, 2520, 756000, 180, 2268000, 7560, 831600, 30, 415800, 6300, 2079000, 210, 485100, 2310, 30030, 2, 60060, 4620
Offset: 0

Views

Author

Antti Karttunen, Nov 16 2016

Keywords

Comments

This sequence can be used for filtering certain Stern polynomial (see A125184, A260443) related sequences, because it matches only with any such sequence b that can be computed as b(n) = f(A260443(n)), where f(n) is any function that depends only on the prime signature of n (some of these are listed under the index entry for "sequences computed from exponents in ...").
Matching in this context means that the sequence a matches with the sequence b iff for all i, j: a(i) = a(j) => b(i) = b(j). In other words, iff the sequence b partitions the natural numbers to the same or coarser equivalence classes (as/than the sequence a) by the distinct values it obtains.
Some of these are listed on the last line ("Sequences that partition N into ...") of Crossrefs section.

Crossrefs

Sequences that partition or seem to partition N into same or coarser equivalence classes: A002487, A126606, A277314, A277315, A277325, A277326, A277700, A277705.
The following are less certain: A007302 (not proved, but the first 10000 terms match), A072453, A110955 (uncertain, but related to A007302), A218799, A218800.
Note that the base-2 related sequences A069010 and A277561 (= 2^A069010(n)) do not match, although at first it seems so, up to for at least 139 initial terms. Also A028928 belongs to a different family.

Programs

  • Mathematica
    a[n_] := a[n] = Which[n < 2, n + 1, EvenQ@ n, Times @@ Map[#1^#2 & @@ # &, FactorInteger[#] /. {p_, e_} /; e > 0 :> {Prime[PrimePi@ p + 1], e}] - Boole[# == 1] &@ a[n/2], True, a[#] a[# + 1] &[(n - 1)/2]]; Table[Times @@ MapIndexed[Prime[First@ #2]^#1 &, Sort[FactorInteger[#][[All, -1]], Greater]] - Boole[# == 1] &@ a@ n, {n, 0, 66}] (* Michael De Vlieger, May 12 2017 *)
  • Scheme
    (define (A278243 n) (A046523 (A260443 n)))

Formula

a(n) = A046523(A260443(n)).

A284264 a(n) = A001222(A283983(n)).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Mar 25 2017

Keywords

Comments

a(n) = Sum_{c} floor(c/2), where c ranges over each coefficient of terms c * x^k in the Stern polynomial B(n,x), thus sum of the halved terms (for odd terms floored down) on row n of table A125184.

Crossrefs

Cf. A023758 (gives the positions of zeros).

Programs

Formula

a(n) = A001222(A283983(n)).
Other identities and observations. For all n >= 0:
a(2n) = a(n).
a(n) = (1/2) * (A002487(n) - A277700(n)).
2*a(n) <= A284272(n).

A284271 Number of terms with coefficient 1 in the Stern polynomial B(n,x): a(n) = A056169(A260443(n)).

Original entry on oeis.org

0, 1, 1, 2, 1, 1, 2, 3, 1, 2, 1, 2, 2, 1, 3, 4, 1, 3, 2, 1, 1, 1, 2, 2, 2, 2, 1, 2, 3, 1, 4, 5, 1, 4, 3, 1, 2, 2, 1, 1, 1, 1, 1, 2, 2, 1, 2, 2, 2, 2, 2, 1, 1, 1, 2, 2, 3, 2, 1, 2, 4, 1, 5, 6, 1, 5, 4, 1, 3, 2, 1, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 1, 2, 2, 1, 2, 2, 2, 2, 2, 1, 2, 2, 1, 1, 1, 1, 1, 2, 2, 1, 2, 2, 3, 2, 2, 1, 1, 1, 2, 2, 4
Offset: 0

Views

Author

Antti Karttunen, Mar 25 2017

Keywords

Comments

Number of 1's on row n of table A125184.

Crossrefs

Cf. A002487, A056169, A125184, A260443, A277700, A284272, A284267 (odd bisection).

Programs

Formula

a(n) = A056169(A260443(n)).
Other identities and observations. For all n >= 0:
A002487(n) = a(n) + A284272(n).
a(n) <= A277700(n).
Showing 1-6 of 6 results.