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

A072219 Any number n can be written uniquely in the form n = 2^k_1 - 2^k_2 + 2^k_3 - ... + 2^k_{2r+1} where the signs alternate, there are an odd number of terms, and k_1 > k_2 > k_3 > ... > k_{2r+1} >= 0; sequence gives number of terms 2r+1.

Original entry on oeis.org

1, 1, 3, 1, 3, 3, 3, 1, 3, 3, 5, 3, 3, 3, 3, 1, 3, 3, 5, 3, 5, 5, 5, 3, 3, 3, 5, 3, 3, 3, 3, 1, 3, 3, 5, 3, 5, 5, 5, 3, 5, 5, 7, 5, 5, 5, 5, 3, 3, 3, 5, 3, 5, 5, 5, 3, 3, 3, 5, 3, 3, 3, 3, 1, 3, 3, 5, 3, 5, 5, 5, 3, 5, 5, 7, 5, 5, 5, 5, 3, 5, 5, 7, 5, 7, 7, 7, 5, 5, 5, 7, 5, 5, 5, 5, 3, 3, 3, 5, 3, 5, 5, 5, 3, 5
Offset: 1

Views

Author

N. J. A. Sloane, Jul 05 2002

Keywords

Comments

2^k_1 is smallest power of 2 that is >= n.
The first Mathematica program computes the sequence for numbers 1 to 2^m. - T. D. Noe, Jul 15 2002
a(A000079(n)) = 1; a(A238246(n)) = 3; a(A238247(n)) = 5; a(A238248(n)) = 7. - Reinhard Zumkeller, Feb 20 2014
Add 1 to every other terms of A005811. - N. J. A. Sloane, Jan 14 2017

Examples

			1=1, 2=2, 3=4-2+1, 4=4, 5=8-4+1, 6=8-4+2, ...
		

References

  • P. Bachmann, Niedere Zahlentheorie (1902, 1910), reprinted Chelsea, NY, 1968, vol. 2, pp. 61-62.

Crossrefs

Programs

  • Haskell
    a072219 = (+ 1) . (* 2) . a033264 . subtract 1
    -- Reinhard Zumkeller, Feb 20 2014
  • Mathematica
    Needs["DiscreteMath`Combinatorica`"]; sumit[s_List] := Module[{i, ss=0}, Do[If[OddQ[i], ss+=s[[i]], ss-=s[[i]]], {i, Length[s]}]; ss]; m=8; powers=Table[2^i, {i, 0, m}]; lst=Table[0, {2^m}]; sets={}; Do[sets=Union[sets, KSubsets[powers, i]], {i, 1, m+1, 2}]; Do[t=sets[[i]]; lst[[sumit[t]]]=Length[t], {i, Length[sets]}]; lst
    (* second program *)
    a[n_] := 2 Count[Split[IntegerDigits[n-1, 2], #1 == 1 && #2 == 0 &], {1, 0} ] + 1; Array[a, 105] (* Jean-François Alcover, Apr 01 2016 *)

Formula

G.f.: 1/(1+x) + (1/(1-x)) * Sum_{r>=0} x^(2^r) / (1+x^(2^(r+1))). - Ramasamy Chandramouli, Dec 22 2012

Extensions

More terms from T. D. Noe, Jul 15 2002

A238246 Numbers m such that A072219(m) = 3.

Original entry on oeis.org

3, 5, 6, 7, 9, 10, 12, 13, 14, 15, 17, 18, 20, 24, 25, 26, 28, 29, 30, 31, 33, 34, 36, 40, 48, 49, 50, 52, 56, 57, 58, 60, 61, 62, 63, 65, 66, 68, 72, 80, 96, 97, 98, 100, 104, 112, 113, 114, 116, 120, 121, 122, 124, 125, 126, 127, 129, 130, 132, 136, 144
Offset: 1

Views

Author

Reinhard Zumkeller, Feb 20 2014

Keywords

Comments

a(n) = A043687(n) + 1.

Crossrefs

Programs

  • Haskell
    a238246 n = a238246_list !! (n-1)
    a238246_list = filter ((== 3) . a072219) [1..]

A238248 Numbers m such that A072219(m) = 7.

Original entry on oeis.org

43, 75, 83, 85, 86, 87, 91, 107, 139, 147, 149, 150, 151, 155, 163, 165, 166, 167, 169, 170, 172, 173, 174, 175, 179, 181, 182, 183, 187, 203, 211, 213, 214, 215, 219, 235, 267, 275, 277, 278, 279, 283, 291, 293, 294, 295, 297, 298, 300, 301, 302, 303, 307
Offset: 1

Views

Author

Reinhard Zumkeller, Feb 20 2014

Keywords

Comments

a(n) = A043689(n) + 1.

Crossrefs

Programs

  • Haskell
    a238248 n = a238248_list !! (n-1)
    a238248_list = filter ((== 7) . a072219) [1..]

A043688 a(n) = (s(n)-1)/2, where s(n) is the n-th number whose base-2 representation has exactly 5 runs.

Original entry on oeis.org

10, 18, 20, 21, 22, 26, 34, 36, 37, 38, 40, 41, 43, 44, 45, 46, 50, 52, 53, 54, 58, 66, 68, 69, 70, 72, 73, 75, 76, 77, 78, 80, 81, 83, 87, 88, 89, 91, 92, 93, 94, 98, 100, 101, 102, 104, 105, 107, 108, 109, 110, 114, 116, 117, 118, 122
Offset: 1

Views

Author

Keywords

Comments

a(n) = A238247(n) - 1. - Reinhard Zumkeller, Feb 20 2014

Crossrefs

Cf. A238247.

Programs

  • Mathematica
    (#-1)/2&/@Select[Range[400],Length[Split[IntegerDigits[#,2]]]==5&] (* Harvey P. Dale, Oct 04 2013 *)
Showing 1-4 of 4 results.