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.

A140690 A positive integer n is included if n written in binary can be subdivided into a number of runs all of equal-length, the first run from the left consisting of all 1's, the next run consisting of all 0's, the next run consisting of all 1's, the next run consisting of all 0's, etc.

Original entry on oeis.org

1, 2, 3, 5, 7, 10, 12, 15, 21, 31, 42, 51, 56, 63, 85, 127, 170, 204, 240, 255, 341, 455, 511, 682, 819, 992, 1023, 1365, 2047, 2730, 3276, 3640, 3855, 4032, 4095, 5461, 8191, 10922, 13107, 16256, 16383, 21845, 29127, 31775, 32767, 43690, 52428, 61680
Offset: 1

Views

Author

Leroy Quet, Jul 11 2008

Keywords

Comments

Also: numbers of the form (2^s-1)*[4^{s*(k+1)}-1]/(4^s-1) or 2^s(2^s-1)*[4^{s*(k+1)}-1]/(4^s-1), s>=1, k>=0. Subsequences are, with the possible exception of terms at n=0, A002450(n), A043291(n), A015565(2n), A093134(2n+1), A000225(n), A020522(n). [R. J. Mathar, Aug 04 2008]
From Emeric Deutsch, Jan 25 2018: (Start)
Also the indices of the compositions having equal parts.
We define the index of a composition to be the positive integer whose binary form has run-lengths (i.e. runs of 1's, runs of 0's, etc., from left to right) equal to the parts of the composition. Example: the composition [1,1,3,1] has index 46 since the binary form of 46 is 101110. The integer 992 is in the sequence since its binary form is 1111100000 and the composition [5,5] has equal parts. The integer 100 is not in the sequence since its binary form is 1100100 and the composition [2,2,1,2] does not have equal parts.
The command c(n) from the Maple program yields the composition having index n. (End)

Examples

			819 in binary is 1100110011. The runs of 0's and 1's are (11)(00)(11)(00)(11). Each run (alternating 1's and 0's) is the same length. So 819 is in the sequence.
		

Crossrefs

Programs

  • Haskell
    import Data.Set (singleton, deleteFindMin, insert)
    a140690 n = a140690_list !! (n-1)
    a140690_list = f $ singleton (1, 1, 2) where
       f s | k == 1 = m : f (insert (2*b-1, 1, 2*b) $ insert (b*m, k+1, b) s')
           | even k    = m : f (insert (b*m+b-1, k+1, b) s')
           | otherwise = m : f (insert (b*m, k+1, b) s')
           where ((m, k, b), s') = deleteFindMin s
    -- Reinhard Zumkeller, Feb 21 2014
  • Maple
    Runs := proc (L) local j, r, i, k: j := 1: r[j] := L[1]: for i from 2 to nops(L) do if L[i] = L[i-1] then r[j] := r[j], L[i] else j := j+1: r[j] := L[i] end if end do: [seq([r[k]], k = 1 .. j)] end proc: RunLengths := proc (L) map(nops, Runs(L)) end proc: c := proc (n) ListTools:-Reverse(convert(n, base, 2)): RunLengths(%) end proc: A := {}: for n to 62000 do if nops(convert(c(n), set)) = 1 then A := `union`(A, {n}) else  end if end do: A; # most of the Maple program is due to W. Edwin Clark. - Emeric Deutsch, Jan 25 2018
  • Mathematica
    Select[Range[62000],Length[Union[Length/@Split[IntegerDigits[#,2]]]]==1&] (* Harvey P. Dale, Mar 22 2012 *)

Extensions

Terms beyond 42 from R. J. Mathar, Aug 04 2008

A015585 a(n) = 9*a(n-1) + 10*a(n-2).

Original entry on oeis.org

0, 1, 9, 91, 909, 9091, 90909, 909091, 9090909, 90909091, 909090909, 9090909091, 90909090909, 909090909091, 9090909090909, 90909090909091, 909090909090909, 9090909090909091, 90909090909090909, 909090909090909091, 9090909090909090909, 90909090909090909091
Offset: 0

Views

Author

Keywords

Comments

Number of walks of length n between any two distinct nodes of the complete graph K_11. Example: a(2)=9 because the walks of length 2 between the nodes A and B of the complete graph ABCDEFGHIJK are: ACB, ADB, AEB, AFB, AGB, AHB, AIB, AJB and AKB. - Emeric Deutsch, Apr 01 2004
Beginning with n=1 and a(1)=1, these are the positive integers whose balanced base-10 representations (A097150) are the first n digits of 1,-1,1,-1,.... Also, a(n) = (-1)^(n-1)*A014992(n) = |A014992(n)| for n >= 1. - Rick L. Shepherd, Jul 30 2004

Crossrefs

Programs

Formula

a(n) = 9*a(n-1) + 10*a(n-2).
From Emeric Deutsch, Apr 01 2004: (Start)
a(n) = 10^(n-1) - a(n-1).
G.f.: x/(1 - 9x - 10x^2). (End)
From Henry Bottomley, Sep 17 2004: (Start)
a(n) = round(10^n/11).
a(n) = (10^n - (-1)^n)/11.
a(n) = A098611(n)/11 = 9*A094028(n+1)/A098610(n). (End)
E.g.f.: exp(-x)*(exp(11*x) - 1)/11. - Elmo R. Oliveira, Aug 17 2024

Extensions

Extended by T. D. Noe, May 23 2011

A015577 a(n+1) = 8*a(n) + 9*a(n-1), a(0) = 0, a(1) = 1.

Original entry on oeis.org

0, 1, 8, 73, 656, 5905, 53144, 478297, 4304672, 38742049, 348678440, 3138105961, 28242953648, 254186582833, 2287679245496, 20589113209465, 185302018885184, 1667718169966657, 15009463529699912, 135085171767299209, 1215766545905692880, 10941898913151235921
Offset: 0

Views

Author

Keywords

Comments

Binomial transform is A011557, with a leading zero. - Paul Barry, Jul 09 2003
Number of walks of length n between any two distinct nodes of the complete graph K_10. Example: a(2) = 8 because the walks of length 2 between the nodes A and B of the complete graph ABCDEFGHIJ are: ACB, ADB, AEB, AFB, AGB, AHB, AIB and AJB. - Emeric Deutsch, Apr 01 2004
The ratio a(n+1)/a(n) converges to 9 as n approaches infinity. - Felix P. Muga II, Mar 09 2014

Crossrefs

Programs

Formula

From Paul Barry, Jul 09 2003: (Start)
G.f.: x/((1+x)*(1-9*x)).
E.g.f. exp(4*x)*sinh(5*x)/5.
a(n) = (9^n - (-1)^n)/10. (End)
a(n) = 9^(n-1)-a(n-1). - Emeric Deutsch, Apr 01 2004
a(n) = round(9^n/10). - Mircea Merca, Dec 28 2010

Extensions

Extended by T. D. Noe, May 23 2011

A015592 a(n) = 10*a(n-1) + 11*a(n-2).

Original entry on oeis.org

0, 1, 10, 111, 1220, 13421, 147630, 1623931, 17863240, 196495641, 2161452050, 23775972551, 261535698060, 2876892678661, 31645819465270, 348104014117971, 3829144155297680, 42120585708274481, 463326442791019290, 5096590870701212191, 56062499577713334100
Offset: 0

Views

Author

Keywords

Comments

Number of walks of length n between any two distinct nodes of the complete graph K_12. Example: a(2)=10 because the walks of length 2 between the nodes A and B of the complete graph ABCDEFGHIJKL are ACB, ADB, AEB, AFB, AGB, AHB, AIB, AJB, AKB and ALB. - Emeric Deutsch, Apr 01 2004

Crossrefs

Programs

Formula

a(n) = 11^(n-1) - a(n-1). G.f.: x/(1 - 10x - 11x^2). - Emeric Deutsch, Apr 01 2004
From Elmo R. Oliveira, Aug 17 2024: (Start)
E.g.f.: exp(5*x)*sinh(6*x)/6.
a(n) = (11^n - (-1)^n)/12. (End)

A015609 a(n) = 11*a(n-1) + 12*a(n-2).

Original entry on oeis.org

0, 1, 11, 133, 1595, 19141, 229691, 2756293, 33075515, 396906181, 4762874171, 57154490053, 685853880635, 8230246567621, 98762958811451, 1185155505737413, 14221866068848955, 170662392826187461
Offset: 0

Views

Author

Keywords

Comments

Number of walks of length n between any two distinct nodes of the complete graph K_13. Example: a(2)=11 because the walks of length 2 between the nodes A and B of the complete graph ABCDEFGHIJKLM are ACB, ADB, AEB, AFB, AGB, AHB, AIB, AJB, AKB, ALB and AMB. - Emeric Deutsch, Apr 01 2004

Crossrefs

Programs

  • Magma
    [(1/13)*(12^n-(-1)^n): n in [0..20]]; // Vincenzo Librandi, Oct 11 2011
    
  • Mathematica
    CoefficientList[Series[x/(1-11*x-12*x^2), {x, 0, 50}], x] (* or *) LinearRecurrence[{11,12}, {0,1}, 30] (* G. C. Greubel, Dec 30 2017 *)
  • PARI
    x='x+O('x^30); concat([0], Vec(x/(1-11*x-12*x^2))) \\ G. C. Greubel, Dec 30 2017
  • Sage
    [lucas_number1(n,11,-12) for n in range(0, 18)] # Zerinvary Lajos, Apr 27 2009
    
  • Sage
    [abs(gaussian_binomial(n,1,-12)) for n in range(0,18)] # Zerinvary Lajos, May 28 2009
    

Formula

From Emeric Deutsch, Apr 01 2004: (Start)
a(n) = 12^(n-1) - a(n-1).
G.f.: x/(1 - 11*x - 12*x^2). (End)
E.g.f.: exp(-x)*(exp(13*x) - 1)/13. - Stefano Spezia, Mar 11 2020

A271427 a(n) = 7^n - a(n-1) for n>0, a(0)=0.

Original entry on oeis.org

0, 7, 42, 301, 2100, 14707, 102942, 720601, 5044200, 35309407, 247165842, 1730160901, 12111126300, 84777884107, 593445188742, 4154116321201, 29078814248400, 203551699738807, 1424861898171642, 9974033287201501, 69818233010410500, 488727631072873507, 3421093417510114542
Offset: 0

Views

Author

Ilya Gutkovskiy, Apr 13 2016

Keywords

Comments

In general, the ordinary generating function for the recurrence b(n) = k^n - b(n-1), where n>0 and b(0)=0, is k*x/((1 + x)*(1 - k*x)). This recurrence gives the closed form b(n) = k*(k^n - (-1)^n)/(k + 1).

Examples

			a(2) = 7^2 - a(2-1) = 49 - 7 = 42.
a(4) = 7^4 - a(4-1) = 2401 - 301 = 2100.
		

Crossrefs

Cf. similar sequences with the recurrence b(n) = k^n - b(n-1): A125122 (k=1), A078008 (k=2), A054878 (k=3), A109499 (k=4), A109500 (k=5), A109501 (k=6), this sequence (k=7), A093134 (k=8), A001099 (k=n).

Programs

  • Mathematica
    LinearRecurrence[{6, 7}, {0, 7}, 30]
    Table[7 (7^n - (-1)^n)/8, {n, 0, 30}]
  • PARI
    vector(50, n, n--; 7*(7^n-(-1)^n)/8) \\ Altug Alkan, Apr 13 2016
    
  • Python
    for n in range(0,10**2):print((int)((7*(7**n-(-1)**n))/8))
    # Soumil Mandal, Apr 14 2016

Formula

O.g.f.: 7*x/(1 - 6*x - 7*x^2).
E.g.f.: (7/8)*(exp(7*x) - exp(-x)).
a(n) = 6*a(n-1) + 7*a(n-2).
a(n) = 7*(7^n - (-1)^n)/8.
a(n) = 7*A015552(n).
Sum_{n>0} 1/(a(n) + a(n-1)) = 1/6 = A020793.
Limit_{n->oo} a(n-1)/a(n) = 1/7 = A020806.
Showing 1-6 of 6 results.