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.

A181565 a(n) = 3*2^n + 1.

Original entry on oeis.org

4, 7, 13, 25, 49, 97, 193, 385, 769, 1537, 3073, 6145, 12289, 24577, 49153, 98305, 196609, 393217, 786433, 1572865, 3145729, 6291457, 12582913, 25165825, 50331649, 100663297, 201326593, 402653185, 805306369, 1610612737, 3221225473
Offset: 0

Views

Author

M. F. Hasler, Oct 30 2010

Keywords

Comments

From Peter Bala, Oct 28 2013: (Start)
Let x and b be positive real numbers. We define an Engel expansion of x to the base b to be a (possibly infinite) nondecreasing sequence of positive integers [a(1), a(2), a(3), ...] such that we have the series representation x = b/a(1) + b^2/(a(1)*a(2)) + b^3/(a(1)*a(2)*a(3)) + .... Depending on the values of x and b such an expansion may not exist, and if it does exist it may not be unique. When b = 1 we recover the ordinary Engel expansion of x.
This sequence gives an Engel expansion of 2/3 to the base 2, with the associated series expansion 2/3 = 2/4 + 2^2/(4*7) + 2^3/(4*7*13) + 2^4/(4*7*13*25) + ....
More generally, for n and m positive integers, the sequence [m + 1, n*m + 1, n^2*m + 1, ...] gives an Engel expansion of the rational number n/m to the base n. See the cross references for several examples. (End)
The only squares in this sequence are 4, 25, 49. - Antti Karttunen, Sep 24 2023

Crossrefs

Essentially a duplicate of A004119.
A002253 and A039687 give the primes in this sequence, and A181492 is the subsequence of twin primes.

Programs

Formula

a(n) = A004119(n+1) = A103204(n+1) for all n >= 0.
From Ilya Gutkovskiy, Jun 01 2016: (Start)
O.g.f.: (4 - 5*x)/((1 - x)*(1 - 2*x)).
E.g.f.: (1 + 3*exp(x))*exp(x).
a(n) = 3*a(n-1) - 2*a(n-2). (End)
a(n) = 2*a(n-1) - 1. - Miquel Cerda, Aug 16 2016
For n >= 0, A005940(a(n)) = A001248(1+n). - Antti Karttunen, Sep 24 2023

A209281 Start with first run [0,1] then, for n >= 2, the n-th run has length 2^n and is the concatenation of [a(1),a(2),...,a(2^n/2)] and [n-a(1),n-a(2),...,n-a(2^n/2)].

Original entry on oeis.org

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

Views

Author

Benoit Cloitre, Jan 16 2013

Keywords

Comments

Also the sum of the odd bisection (odd-indexed parts) of the (n-1)-th composition in standard order, where the k-th composition in standard order (graded reverse-lexicographic, A066099) is obtained by taking the set of positions of 1's in the reversed binary expansion of k, prepending 0, taking first differences, and reversing again. Note that this sequence counts {} as composition number 1 (instead of the usual 0). For example, composition number 741 in standard order is (2,1,1,3,2,1), with odd bisection (2,1,2), so a(742) = 2 + 1 + 2 = 5. - Gus Wiseman, Aug 24 2021

Examples

			[0,1] -> [0,1] U [2-0,2-1] =
[0,1,2,1] -> [0,1,2,1] U [3-0,3-1,3-2,3-1] =
[0,1,2,1,3,2,1,2] etc.
From _Gus Wiseman_, Aug 08 2021: (Start)
As a triangle without the initial 0, row-lengths A000079:
  1
  2 1
  3 2 1 2
  4 3 2 3 1 2 3 2
  5 4 3 4 2 3 4 3 1 2 3 2 4 3 2 3
  6 5 4 5 3 4 5 4 2 3 4 3 5 4 3 4 1 2 3 2 4 3 2 3 5 4 3 4 2 3 4 3
(End)
		

Crossrefs

Cf. A010060 (Thue-Morse), A103204 (indices of 1's).
Cf. A029837 (binary order), A000120 (binary weight), A006068 (inverse Gray), A272020 (bit positions).
Cf. A089215.
As a triangle: A000079 (row lengths), A001792 (row sums).
Other composition part sums: A124754. A346633.
Also the sum of row A346702(n-1) of A066099.
Cf. A346697 (on prime indices).

Programs

  • Mathematica
    Table[Total[First/@Partition[Append[Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse,0],2]],{n,0,100}] (* Gus Wiseman, Aug 08 2021 *)
  • PARI
    /* compute 2^15 terms */ v=[0,1];for(n=2,15,v=concat(v,vector(2^n/2,i,n-v[i]));a(n)=v[n];)
    
  • PARI
    a(n) = n--; my(s=1,ns); while((ns=n>>s), n=bitxor(n,ns); s<<=1); hammingweight(n); \\ Kevin Ryde, May 14 2022

Formula

Let T(n)=A010060(n) then for n>=1 a(2n)=a(n)+1-T(n-1) and a(2n+1)=a(n+1)+T(n).
For n>=2 a(n) = a(ceiling(n/2))+T(n-1) hence:
a(n) = Sum_{k=0..ceiling(log(n-1)/log(2))} T(floor((n-1)/2^k)).
For k>=0 a(3*2^k+1)=1 (more precisely a(n)=1 iff n is in A103204), a(2^k+1)=k+1, a(5*2^k+1)=2, a(7*2^k+1)=k+2 etc.
From Gus Wiseman, Aug 18 2021: (Start)
a(n + 1) = (A029837(n) + A124754(n))/2.
a(n + 1) = A029837(n) - A346633(n).
a(n + 1) = A346633(n) - A124754(n).
a(n + 1) = A029837(A346702(n)).
(End)
From Kevin Ryde, May 14 2022: (Start)
a(n) = A000120(A006068(n-1)), binary weight of inverse binary Gray code.
a(n) = Sum_{k=1..A000120(n-1)} (-1)^(k-1) * A272020(n-1,k), alternating sum of 1-bit positions.
a(n) = A089215(n) - 1.
(End)

A004759 Binary expansion starts 111.

Original entry on oeis.org

7, 14, 15, 28, 29, 30, 31, 56, 57, 58, 59, 60, 61, 62, 63, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244
Offset: 1

Views

Author

Keywords

Comments

This is the minimal recursive sequence such that a(1)=7, A007814(a(n))= A007814(n) and A010060(a(n))=A010060(n). - Vladimir Shevelev, Apr 23 2009

Examples

			30 in binary is 11110, so 30 is in sequence.
		

Crossrefs

Programs

  • Haskell
    import Data.List (transpose)
    a004759 n = a004759_list !! (n-1)
    a004759_list = 7 : concat (transpose [zs, map (+ 1) zs])
                       where zs = map (* 2) a004759_list
    -- Reinhard Zumkeller, Dec 03 2015
    
  • Mathematica
    w = {1, 1, 1}; Select[Range[5, 244], If[# < 2^(Length@ w - 1), True, Take[IntegerDigits[#, 2], Length@ w] == w] &] (* Michael De Vlieger, Aug 10 2016 *)
    Sort[FromDigits[#,2]&/@(Flatten[Table[Join[{1,1,1},#]&/@Tuples[{1,0},n],{n,0,5}],1])] (* Harvey P. Dale, Sep 01 2016 *)
  • PARI
    a(n)=n+6*2^floor(log(n)/log(2))
    
  • Python
    def A004759(n): return n+(3<Chai Wah Wu, Jul 13 2022

Formula

a(2n) = 2a(n), a(2n+1) = 2a(n) + 1 + 6[n==0].
a(n) = n + 6 * 2^floor(log_2(n)) = A004758(n) + A053644(n).
a(n+1) = min{m > a(n): A007814(m) = A007814(n+1) and A010060(m) = A010060(n+1)}. a(2^k) - a(2^k-1) = A103204(k+2), k >= 1. - Vladimir Shevelev, Apr 23 2009
a(2^m+k) = 7*2^m + k, m >= 0, 0 <= k < 2^m. - Yosu Yurramendi, Aug 08 2016

Extensions

Edited by Ralf Stephan, Oct 12 2003

A181492 Primes of the form p=3*2^k+1 such that p-2 is also a prime.

Original entry on oeis.org

7, 13, 193, 786433
Offset: 1

Views

Author

M. F. Hasler, Oct 30 2010

Keywords

Comments

Sequence A181490 lists the exponents k, sequences A181491 and A181493 the corresponding lesser twin prime and their average.
a(5) > 3 * 2^3000 + 1. - Max Z. Scialabba, Dec 24 2023

Crossrefs

Programs

  • Mathematica
    Select[3 2^Range[100]+1,And@@PrimeQ[{#,#-2}]&] (* Harvey P. Dale, Jun 19 2013 *)
  • PARI
    for( k=1,999, ispseudoprime(3<
    				

Formula

A181492 = A181491 + 2 = A181493 + 1 = 3*2^A181490 + 1 = intersection of A004119 or A103204 or A181495 with A006512 or A001097.

A266926 a(0)=0, a(1)=1, a(2)=10; for n>2, a(n) = concat(a(1), ..., a(n-1)).

Original entry on oeis.org

0, 1, 10, 110, 110110, 110110110110, 110110110110110110110110, 110110110110110110110110110110110110110110110110, 110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110
Offset: 0

Views

Author

Giovanni Teofilatto, Jan 06 2016

Keywords

Comments

Decimal conversions: 0, 1, 2, 6, 54, 3510, 14380470, 241264265751990, 67909853583655146508751957430, ... . (See A267348.) - Michael De Vlieger, Jan 06 2016
After 10, a(n) is '110' repeated 2^(n-3) times. Therefore, for n>3, a(n) is the concatenation of a(n-1) with itself.
After 1, each term with the 0's omitted is a member of A136308.
The number of digits in a(n) is A098011(n+1).
The number of digits in a(n+2)/a(n+1) gives A103204 with 2 repeated.

Examples

			a(3) = concat(1, 10, 110) = 110110.
a(4) = concat(1, 10, 110, 110110) = 110110110110.
		

Crossrefs

Programs

  • Magma
    [n le 2 select n*5^(n-1) else 110*(10^(3*2^(n-3))-1)/999: n in [0..8]]; // Bruno Berselli, Jan 29 2016
  • Mathematica
    a = {0, 1}; Do[AppendTo[a, FromDigits@ Flatten@ Map[IntegerDigits@ # &, If[n < 2, Reverse@ a, a]]], {n, 8}]; a (* Michael De Vlieger, Jan 06 2016 *)

Formula

a(n) = 110*(10^(3*2^(n-3))-1)/999 for n>2. - Bruno Berselli, Jan 29 2016

Extensions

Definition by Michael De Vlieger, Jan 06 2016
Edited by Editors of the OEIS, Jan 29 2016

A136673 Triangle of coefficients from a polynomial recursion for Galois field GF(2^n) polynomials: p(x,n)=(x+1)*p(x,n-1)-x*p(x,n-2); or f(x,n)=x^n+x+1;.

Original entry on oeis.org

2, 1, 1, 2, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1
Offset: 1

Views

Author

Roger L. Bagula, Apr 05 2008

Keywords

Comments

Row sums are:
{3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3}
The result is very dependent on the two initial polynomials.

Examples

			{2, 1},
{1, 2},
{1, 1, 1},
{1, 1, 0, 1},
{1, 1, 0, 0, 1},
{1, 1, 0, 0, 0, 1},
{1, 1, 0, 0, 0, 0, 1},
{1, 1, 0, 0, 0, 0, 0, 1},
{1, 1, 0, 0, 0, 0, 0, 0, 1},
{1, 1, 0, 0, 0, 0, 0, 0, 0, 1},
{1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1}
		

References

  • Taylor L. Booth, Sequential Machines and Automata Theory, John Wiley and Sons, Inc., 1967, Appendix I

Crossrefs

Programs

  • Mathematica
    p[x, 0] = 2 + x; p[x, 1] = 1 + 2*x; p[x_, n_] := p[x, n] = (x + 1)*p[x, n - 1] - x*p[x, n - 2]; Table[ExpandAll[p[x, n]], {n, 0, 10}]; a = Table[CoefficientList[p[x, n], x], {n, 0, 10}] Flatten[a]

Formula

p(x,0)=2+x;p(x,1)=1+2*x; p(x,n)=(x+1)*p(x,n-1)-x*p(x,n-2); or f(x,n)=x^n+x+1;
Showing 1-6 of 6 results.