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.

Previous Showing 11-17 of 17 results.

A370048 Number of binary strings of length n in which the number of substrings 00 is one more than that of substrings 01.

Original entry on oeis.org

0, 0, 1, 1, 2, 6, 10, 18, 40, 76, 141, 285, 558, 1066, 2097, 4121, 8000, 15660, 30763, 60171, 117918, 231690, 454816, 893208, 1756688, 3455580, 6799195, 13388587, 26375466, 51974798, 102470402, 202108730, 398756664, 787025260, 1553900235, 3068937675, 6062944710, 11981429394, 23683822694, 46828287038
Offset: 0

Views

Author

Max Alekseyev, Apr 30 2024

Keywords

Crossrefs

Programs

  • PARI
    { a370048(n) = (n > 1) * sum(m=0,(n-1)\3, binomial(2*m,m+1) * binomial(n-1-2*m,m) + binomial(2*m+1,m) * binomial(n-2-2*m,m) ); }
    
  • Python
    from math import comb
    def A370048(n): return 0 if n<2 else 1+sum((x:=comb((k:=m<<1),m+1)*comb(n-1-k,m))+x*(k+1)*(n-1-3*m)//(m*(n-1-k)) for m in range(1,(n+2)//3)) # Chai Wah Wu, May 01 2024

Formula

For n >= 2, a(n) = Sum_{m=0..floor((n-1)/3)} binomial(2*m,m+1) * binomial(n-1-2*m,m) + binomial(2*m+1,m) * binomial(n-2-2*m,m).
For n >= 4, a(n) = ( (n-2)*(2*n-1)*(n^2-n-4)*a(n-1) - (n^2-5*n+2)*(n^2+n-4)*a(n-2) + 2*(n-3)*n^2*(2*n-3)*a(n-3) - 4*(n-3)*(n-1)^2*n*a(n-4) ) / (n-2)^2 / (n-1) / (n+2).
a(n) = 2*A371358(n+1) - A371358(n+2) + A163493(n+1) - A163493(n).
G.f. ((1-x^2-2*x^3)*(1-2*x+x^2-4*x^3+4*x^4)^(-1/2) - 1 - x)/x^2/2, which can be expressed in terms of g.f. C(x) = (1-sqrt(1-4*x))/x/2 for Catalan number (A000108) as x*((x+1)*C(x^3/(1-x))-1)/(1-x-2*x^3*C(x^3/(1-x))).

A091283 Exponent of 2 in -1+prime[n]^s, if s is an exponent of the form s=8k-4.

Original entry on oeis.org

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

Views

Author

Labos Elemer, Jan 22 2004

Keywords

Crossrefs

Programs

  • Mathematica
    Table[{8*k-4, Table[Part[Flatten[FactorInteger [ -1+Prime[n]^(8*k-4)]], 2], {n, 2, m}]}, {k, 1, 2}]

A167167 A001045 with a(0) replaced by -1.

Original entry on oeis.org

-1, 1, 1, 3, 5, 11, 21, 43, 85, 171, 341, 683, 1365, 2731, 5461, 10923, 21845, 43691, 87381, 174763, 349525, 699051, 1398101, 2796203, 5592405, 11184811, 22369621, 44739243, 89478485, 178956971, 357913941, 715827883, 1431655765, 2863311531
Offset: 0

Views

Author

Paul Curtz, Oct 29 2009

Keywords

Comments

Essentially the same as A001045, and perhaps also A152046.
Also the binomial transform of the sequence with terms (-1)^(n+1)*A128209(n).

Programs

  • GAP
    Concatenation([-1], List([1..35], n-> (2^n -(-1)^n)/3) ); # G. C. Greubel, Dec 01 2019
  • Magma
    [-1] cat [(2^n -(-1)^n)/3 : n in [1..35]]; // G. C. Greubel, Dec 01 2019
    
  • Maple
    seq( `if`(n=0, -1, (2^n -(-1)^n)/3), n=0..35); # G. C. Greubel, Dec 01 2019
  • Mathematica
    CoefficientList[Series[(2*x-1+2*x^2)/((1+x)*(1-2*x)), {x, 0, 35}], x] (* G. C. Greubel, Jun 04 2016 *)
    Table[If[n==0, -1, (2^n -(-1)^n)/3], {n,0,35}] (* G. C. Greubel, Dec 01 2019 *)
    LinearRecurrence[{1,2},{-1,1,1},40] (* Harvey P. Dale, Jul 23 2025 *)
  • PARI
    vector(36, n, if(n==1, -1, (2^(n-1) +(-1)^n)/3 ) ) \\ G. C. Greubel, Dec 01 2019
    
  • Sage
    [-1]+[lucas_number1(n, 1, -2) for n in (1..35)] # G. C. Greubel, Dec 01 2019
    

Formula

a(n) = A001045(n), n>0.
a(n) + a(n+1) = 2*A001782(n) = 2*A131577(n) = A155559(n) = A090129(n+2), n>0.
G.f.: (2*x^2 + 2*x - 1)/((1+x)*(1-2*x)).
E.g.f.: (exp(2*x) - exp(-x) - 3)/3. - G. C. Greubel, Dec 01 2019

Extensions

Edited and extended by R. J. Mathar, Nov 01 2009

A091284 Exponent of 2 in -1+prime[n]^s, if s is an exponent of form 16k-8. Except a(1)=0, a(n)=1+A091283(n).

Original entry on oeis.org

0, 5, 5, 6, 5, 5, 7, 5, 6, 5, 8, 5, 6, 5, 7, 5, 5, 5, 5, 6, 6, 7, 5, 6, 8, 5, 6, 5, 5, 7, 10, 5, 6, 5, 5, 6, 5, 5, 6, 5, 5, 5, 9, 9, 5, 6, 5, 8, 5, 5
Offset: 1

Views

Author

Labos Elemer, Jan 22 2004

Keywords

Comments

Exponents of 2 in -1+p^s if the exponent s[u]=(2^u)k-(2^(u-1) comes from other sequence generated with s[u-1] exponent by adding 1 to terms of the "previous" sequence. E.g. s=256k-128 needed an addition of 6 to the terms of A091282.

Crossrefs

Programs

  • Mathematica
    Table[{8*k-4, Table[Part[Flatten[FactorInteger [ -1+Prime[n]^(16*k-8)]], 2], {n, 2, 50}]}, {k, 1, 2}]

A171968 Odd numbers of A181733 in the order of appearance.

Original entry on oeis.org

1, 1, 1, 3, 1, 5, 3, 7, 1, 9, 5, 13, 3, 7, 11, 15, 1, 17, 9, 25, 5, 13, 21, 29, 3, 7, 11, 15, 19, 23, 27, 31, 1, 33, 17, 49, 9, 25, 41, 57, 5, 13, 21, 29, 37, 45, 53, 61, 3, 7, 11, 15, 19, 23, 27, 31, 35, 39, 43, 47, 51, 55, 59, 63
Offset: 0

Views

Author

Paul Curtz, Nov 19 2010

Keywords

Comments

This deals with an aspect of the Josephus problem.
Contribution from Paul Curtz, May 30 2011: (Start)
For comparison with A000265, one can arrange the sequence in blocks of length (and with row sum) 2^k, like
1;
1;
1, 3;
1, 5, 3, 7;
1, 9, 5, 13, 3, 7, 11, 15;
1, 17, 9, 25, 5, 13, 21, 29, 3, 7, 11, 15, 19, 23, 27, 31;
or
1, 1,
1, 3,
1, 5, 3, 7,
1, 9, 5, 13, 3, 7, 11, 15,
The even numbers of A181733 are essentially A152423:
2,
2,4,
2,4,6,8,
2,4,6,8,10,12,14,16,
2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32.
(End)

Crossrefs

Cf. A090129.

A210846 (5^(3^(n-1)) + 1)/(2*3^n).

Original entry on oeis.org

1, 7, 36169, 45991238252616223, 851008860651263039991161205833295116837255258128476241
Offset: 1

Views

Author

Wolfdieter Lang, Apr 24 2012

Keywords

Comments

The number of digits of a(n) is 1, 1, 5, 17, 54, 167, 506, 1525, ... .
Integer 2*a(n) implies that 5^delta(3^n) == -1 (mod 3^n), n>=1, with the degree delta(3^n) = phi(2*3^n)/2 = 3^(n-1) of the minimal polynomial C(3^n,x) of the algebraic number 2*cos(pi/3^n). For delta and the coefficient array of C see A055034 and A187360, respectively. That 2*a(n) is indeed an even integer can be shown by analyzing the terms of the binomial expansion of (6-1)^(3^(n-1)) + 1.
This congruence implies that floor(5^(3^(n-1))/3^n) = 2*a(n) - 1, i.e., it is odd. Hence 5^delta(3^n) == +1 (Modd 3^n), n>=2. For Modd n (not to be confused with mod n) see a comment on A203571. One can show that 5 is the smallest positive primitive root Modd 3^n for n>=2 (for n=1 one has 1^1 == +1 (Modd 3)). See A206550. The proof uses the fact that the order of 5 using multiplication Modd 3^n has to be a divisor of delta(3^n)=3^(n-1), i.e., a power of 3. This is because the multiplicative group Modd 3^n has order delta(3^n) and the subgroup formed by the cycle has the order of 5 considered Modd 3^n. Then apply Lagrange's theorem. That for n>=2 no number 5^(3^(n-1-j)), with j=1, 2..., n-1, is congruent +1 (Modd 3^n) follows from the above established congruence and an analysis of the relevant expansion for a given smaller power.
The above statements show that for n>=1 the multiplicative group Modd 3^n is cyclic (for n=1 the cycle is [1], and for n>=2 the cycle is generated by 5). For the cyclic moduli see A206551.

Examples

			n=1: (5^1+1)/6  = 1; n=2: (5^3 + 1)/18 = 126/18 = 7;
n=3: (5^9 +1)/(2*27) = 1953126/54 = 36169.
		

Crossrefs

Cf. A000244 (powers of 3), A068531, A090129 (the case Modd 2^n).

Formula

a(n) = (5^(3^(n-1)) + 1)/(2*3^n).

A233656 a(n) = 3*a(n-1) - 2*(n-1), with a(0) = 1.

Original entry on oeis.org

1, 3, 7, 17, 45, 127, 371, 1101, 3289, 9851, 29535, 88585, 265733, 797175, 2391499, 7174469, 21523377, 64570099, 193710263, 581130753, 1743392221, 5230176623, 15690529827, 47071589437, 141214768265, 423644304747, 1270932914191, 3812798742521, 11438396227509, 34315188682471
Offset: 0

Views

Author

Richard R. Forberg, Dec 14 2013

Keywords

Comments

Inverse binomial transform of this sequence is A090129.
Conjecture: Last digit of a(n) has repeating pattern of 20 digits as follows: {1, 3, 7, 7, 5, 7, 1, 1, 9, 1, 5, 5, 3, 5, 9, 9, 7, 9, 3, 3}, with an equal frequency of the five odd digits.

Examples

			a(1) = 3*1 - 2*0 = 3;
a(2) = 3*3 - 2*1 = 7.
		

Crossrefs

Programs

  • Mathematica
    LinearRecurrence[{5,-7,3},{1,3,7},30] (* Harvey P. Dale, Feb 13 2015 *)
  • PARI
    Vec((x^2+2*x-1)/((x-1)^2*(3*x-1)) + O(x^100)) \\ Colin Barker, Dec 17 2013

Formula

a(n) = 3*a(n-1) - 2*(n-1), with a(0) = 1.
(a(n+1) - a(n))/2 = A007051(n).
From Colin Barker, Dec 17 2013: (Start)
a(n) = (1 + 3^n + 2*n)/2.
a(n) = 5*a(n-1) - 7*a(n-2) + 3*a(n-3).
G.f.: (x^2+2*x-1) / ((x-1)^2*(3*x-1)). (End)
E.g.f.: exp(x)*(1 + exp(2*x) + 2*x)/2. - Stefano Spezia, Mar 20 2022
Previous Showing 11-17 of 17 results.