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-10 of 13 results. Next

A023001 a(n) = (8^n - 1)/7.

Original entry on oeis.org

0, 1, 9, 73, 585, 4681, 37449, 299593, 2396745, 19173961, 153391689, 1227133513, 9817068105, 78536544841, 628292358729, 5026338869833, 40210710958665, 321685687669321, 2573485501354569, 20587884010836553, 164703072086692425
Offset: 0

Views

Author

Keywords

Comments

Gives the (zero-based) positions of odd terms in A007556 (numbers n such that A007556(a(n)) mod 2 = 1). - Farideh Firoozbakht, Jun 13 2003
{1, 9, 73, 585, 4681, ...} is the binomial transform of A003950. - Philippe Deléham, Jul 22 2005
Let A be the Hessenberg matrix of order n, defined by: A[1,j]=1, A[i,i]:=8, (i>1), A[i,i-1]=-1, and A[i,j]=0 otherwise. Then, for n >= 1, a(n) = det(A). - Milan Janjic, Feb 21 2010
Let A be the Hessenberg matrix of order n, defined by: A[1,j]=1, A[i,i]:=9, (i>1), A[i,i-1]=-1, and A[i,j]=0 otherwise. Then, for n >= 1, a(n-1) = (-1)^n*charpoly(A,1). - Milan Janjic, Feb 21 2010
This is the sequence A(0,1;7,8;2) = A(0,1;8,0;1) of the family of sequences [a,b:c,d:k] considered by G. Detlefs, and treated as A(a,b;c,d;k) in the W. Lang link given below. - Wolfdieter Lang, Oct 18 2010
a(n) is the total number of squares the carpetmaker has removed after the n-th step of a Sierpiński carpet production. - Ivan N. Ianakiev, Oct 22 2013
For n >= 1, a(n) is the total number of holes in a box fractal (start with 8 boxes, 1 hole) after n iterations. See illustration in link. - Kival Ngaokrajang, Jan 27 2015
From Bernard Schott, May 01 2017: (Start)
Except for 0, 1 and 73, all the terms are composite because a(n) = ((2^n - 1) * (4^n + 2^n + 1))/7.
For n >= 3, all terms are Brazilian repunits numbers in base 8, and so belong to A125134.
a(3) = 73 is the only Brazilian prime in base 8, and so it belongs to A085104 and A285017. (End)

Examples

			From _Zerinvary Lajos_, Jan 14 2007: (Start)
Octal.............decimal
0....................0
1....................1
11...................9
111.................73
1111...............585
11111.............4681
111111...........37449
1111111.........299593
11111111.......2396745
111111111.....19173961
1111111111...153391689
etc. ...............etc. (End)
a(4) = (8^4 - 1)/7 = 585 = 1111_8 = (2^4 - 1) * (4^4 + 2^4 + 1)/7 = 15 * 273/7 = 15 * 39. - _Bernard Schott_, May 01 2017
		

Crossrefs

Programs

Formula

Also sum of cubes of divisors of 2^(n-1): a(n) = A001158(A000079(n-1)). - Labos Elemer, Apr 10 2003 and Farideh Firoozbakht, Jun 13 2003
a(n) = A033138(3n-2). - Alexandre Wajnberg, May 31 2005
From Philippe Deléham, Oct 12 2006: (Start)
a(0) = 0, a(n) = 8*a(n-1) + 1 for n>0.
G.f.: x/((1-8x)*(1-x)). (End)
From Wolfdieter Lang, Oct 18 2010: (Start)
a(n) = 7*a(n-1) + 8*a(n-2) + 2, a(0)=0, a(1)=1.
a(n) = 8*a(n-1) + a(n-2) - 8*a(n-3) = 9*a(n-1) - 8*a(n-2), a(0)=0, a(1)=1, a(2)=9. Observation by Gary Detlefs. See the W. Lang comment and link. (End)
a(n) = Sum_{k=0..n-1} 8^k. - Doug Bell, May 26 2017
E.g.f.: exp(x)*(exp(7*x) - 1)/7. - Stefano Spezia, Mar 11 2023

A284116 a(n) = largest number of distinct words arising in Post's tag system {00, 1101} applied to a binary word w, over all starting words w of length n, or a(n) = -1 if there is a word w with an unbounded trajectory.

Original entry on oeis.org

4, 7, 6, 7, 22, 23, 24, 25, 30, 31, 34, 421, 422, 423, 422, 423, 424, 2169, 2170, 2171, 2170, 2171, 2172, 2165, 2166, 2167, 24566, 24567, 24568, 24567, 24568, 24569, 24568, 24569, 24570, 253513, 253514, 342079, 342080, 342083, 342084, 342103, 20858070
Offset: 1

Views

Author

Jeffrey Shallit, Mar 20 2017

Keywords

Comments

Post's tag system {00, 1101} maps a word w over {0,1} to w', where if w begins with 0, w' is obtained by appending 00 to w and deleting the first three letters, or if w begins with 1, w' is obtained by appending 1101 to w and deleting the first three letters.
The empty word is included in the count.
It is an important open question to decide if there is any word whose orbit grows without limit. - N. J. A. Sloane, Jul 30 2017, based on an email from Allan C. Wechsler
Comment from Don Reble, Aug 01 2017: For n <= 57, all words reach the empty word or a cycle. - N. J. A. Sloane, Aug 01 2017
From David A. Corneth, Aug 02 2017: (Start)
A word w can be described by the pair (c, d) where c is the length of w and d is the number represented by the binary word w. Then 0 <= d < 2^c.
Appending a word ww of m letters to w is the same as setting d to 2^m * w + ww. Preserving only the rightmost q digits of w is the same as setting w to w mod 2^q.
Lastly, we're only really interested in the 1st, 4th, 7th, ... leftmost digits. The others could without loss of generality be set to 0. This can be done with bitand(x, y), with y in A033138.
Therefore this problem can be formulated as follows: Let w = (c, d).
Then if d < 2^(c - 1), w' = (c - 1, bitand(4*d, floor(2^(c + 1) / 7)))
else (if (d >= 2^(c - 1)), w' = (c + 1, bitand(16*d + 13, floor(2^(c + 3) / 7))).
To find a(n), it would be enough to check values d in A152111 with n binary digits and c = n.
(End)
a(110) >= 43913328040672, from w = (100)^k, k=110. - N. J. A. Sloane, Oct 23 2017, based on Lars Blomberg's work on A291792.

Examples

			Suppose n=1. Then w = 0 ->000 -> w' = empty word, and w = 1 -> 11101 -> w' = 01 -> 0100 -> w'' = 0 -> 000 -> w''' = empty word. So a(1) = 4 by choosing w = 1.
For n = 5 the orbit of the word 10010 begins 10010, 101101, 1011101, ..., 0000110111011101, and the next word in the orbit has already appeared. The orbit consists of 22 distinct words.
From _David A. Corneth_, Aug 02 2017: (Start)
The 5-letter word w = 10100 can be described as (a, b) = (5, 20). This is equivalent to (5, bitand(20, floor(2^7 / 7))) = (5, bitand(20, 18)) = (5, 16).
As 16 >= 2^(5-1), w' = (5 + 1, bitand(16*16 + 13, floor(2^(5 + 3) / 7))) = (6, bitand(279, 36)) = (6, 4). w'' = w = (5, 16) so 10100 ~ 10000 ends in a period. (End)
Words w that achieve a(1) through a(7) are 1, 10, 100, 0001, 10010, 100000, 0001000. - _N. J. A. Sloane_, Aug 17 2017
		

References

  • John Stillwell, Elements of Mathematics: From Euclid to Goedel, Princeton, 2016. See page 100, Post's tag system.

Crossrefs

For the 3-shift tag systems {00,1101}, {00, 1011}, {00, 1110}, {00, 0111} see A284116, A291067, A291068, A291069 respectively (as well as the cross-referenced entries mentioned there).

Programs

  • Mathematica
    Table[nmax = 0;
     For[i = 0, i < 2^n, i++, lst = {};
      w = IntegerString[i, 2, n];
      While[! MemberQ[lst, w],
       AppendTo[lst, w];
       If[w == "", Break[]];
       If[StringTake[w, 1] == "0", w = StringDrop[w <> "00", 3],
        w = StringDrop[w <> "1101", 3]]];
    nmax = Max[nmax, Length[lst]]]; nmax, {n, 1, 12}] (* Robert Price, Sep 26 2019 *)
    (* Or, using the (c,d) procedure: *)
     Table[nmax = 0;
     For[i = 0, i < 2^n, i++,
      c = n; d = i; lst = {};
      While[! MemberQ[lst, {c, d}],
       AppendTo[lst, {c, d}];
       If[c == 0,  Break[]];
       If[ d < 2^(c - 1),
        d = BitAnd[4*d, 2^(c - 1) - 1]; c--,
        d = BitAnd[16*d + 13, 2^(c + 1) - 1]; c++]];
    nmax = Max[nmax, Length[lst]]]; nmax, {n, 1, 12}] (* Robert Price, Sep 26 2019 *)

Extensions

a(19)-a(43) from Lars Blomberg, Apr 09 2017
Edited by N. J. A. Sloane, Jul 29 2017 and Oct 23 2017 (adding escape clause in case an infinite trajectory exists)

A046630 Number of cubic residues mod 2^n.

Original entry on oeis.org

1, 2, 3, 5, 10, 19, 37, 74, 147, 293, 586, 1171, 2341, 4682, 9363, 18725, 37450, 74899, 149797, 299594, 599187, 1198373, 2396746, 4793491, 9586981, 19173962, 38347923, 76695845, 153391690, 306783379, 613566757, 1227133514, 2454267027
Offset: 0

Views

Author

Keywords

Examples

			For n=3, the cubes 0^3, 1^3, 2^3, ..., 7^3 reduced mod 2^3 = 8 are 0,1,0,3,0,5,0,7, five different values, so a(3)=5. - _N. J. A. Sloane_, Sep 30 2018
		

Crossrefs

Cf. A033138.

Programs

  • Maple
    A049347 := proc(n) op( (n mod 3)+1,[1,-1,0]) ;end proc:
    A046630 := proc(n) 2^(n+2)/7+2/3-(5*A049347(n)+A049347(n-1))/21 ; end proc: # R. J. Mathar, Feb 27 2011
  • Mathematica
    LinearRecurrence[{2, 0, 1, -2}, {1, 2, 3, 5}, 33] (* Jean-François Alcover, Nov 17 2017 *)
  • PARI
    a(n)=(4<Charles R Greathouse IV, Jan 03 2013

Formula

a(n) = ceiling(2^(n+2)/7) [Finch-Sebah, page 12]. - N. J. A. Sloane, Sep 30 2018
G.f.: (-2*x^3-x^2+1)/((1-2*x)*(1-x^3)).
a(n) = A046530(2^n) = 2^(n+2)/7 + 2/3 - (5*A049347(n)+A049347(n-1))/21. - R. J. Mathar, Feb 27 2011
a(n) = 1 + A033138(n) for n >= 1. - John Keith, Mar 07 2022

A083593 Expansion of 1/((1-2*x)*(1-x^4)).

Original entry on oeis.org

1, 2, 4, 8, 17, 34, 68, 136, 273, 546, 1092, 2184, 4369, 8738, 17476, 34952, 69905, 139810, 279620, 559240, 1118481, 2236962, 4473924, 8947848, 17895697, 35791394, 71582788, 143165576, 286331153, 572662306, 1145324612, 2290649224
Offset: 0

Views

Author

Paul Barry, May 02 2003

Keywords

Comments

Here we let p = 4 to produce the above sequence, but p can be an arbitrary natural number. By letting p = 2, 3, 6, 7 we produce A000975, A033138, A195904 and A117302. We denote by U[p,n,m] the number of cases in which the first player gets killed in a Russian roulette game when p players use a gun with n chambers and m bullets. They never rotate the cylinder after the game starts. The chambers can be represented by the list {1,2,...,n}.
We are going to calculate the following (0), (1), ..., (t) separately. (0) The first player gets killed when one bullet is in the first chamber and the remaining m-1 bullets are in {2,3,...,n}. We have binomial(n-1,m-1) cases for this. (1) The first gets killed when one bullet is in the (p+1)th chamber and the rest of the bullets are in {p+2,...,n}. We have binomial(n-p-1,m-1) cases for this. We continue to calculate and the last is (t), where t = floor((n-m)/p). (t) The first gets killed when one bullet is in the (pt+1)-st chamber and the remaining bullets are in {pt+2,...,n}. We have binomial(n-pt-1,m-1) cases for this. Therefore U[p,n,m] = Sum_{z=0..floor((n-m)/p)} binomial(n-pz-1,m-1). Let A[p,n] be the number of the cases in which the first player gets killed when p players use a gun with n chambers and the number of the bullets can be from 1 to n. Then A[p,n] = Sum_{m=1..n} U[p,n,m]. - Ryohei Miyadera, Tomohide Hashiba, Yuta Nakagawa, Hiroshi Matsui, Jun 04 2006
A001045(n+5) without last digit. - Paul Curtz, Apr 21 2021
a(n) is the number of partitions of n into parts 1 and 4 where there are two colors of part 1 and the order of the colors of parts 1 matters. If the order of colors doesn't matter we get A001972. - Joerg Arndt, Jan 18 2024

Crossrefs

Programs

  • Mathematica
    U[p_,n_,m_,v_]:=Block[{t},t=Floor[(1+p-m+n-v)/p];Sum[Binomial[n-v-p*z,m-1],{z,0,t-1}]]; A[p_,n_,v_]:=Sum[U[p,n,k,v],{k,1,n}]; (* Here we let p = 4 to produce the above sequence, but this code can produce A000975, A033138, A195904, A117302 for p=2,3,6,7.*) Table[A[4,n,1], {n,1,20}] (* Ryohei Miyadera, Tomohide Hashiba, Yuta Nakagawa, Hiroshi Matsui, Jun 04 2006 *)
    CoefficientList[Series[1/((1-2x)(1-x^4)),{x,0,40}],x] (* Vincenzo Librandi, Apr 04 2012 *)
    a[n_] := FromDigits[Table[(Mod[j, 4]/4) // Round, {j, 1, n + 3}], 2] (* Andres Cicuttin, Mar 25 2016 *)
    a[n_] := a[n] = 2 a[n - 1] + 1 - Ceiling[Mod[n, 4]/4]; a[0] = 1;
    Table[a[n], {n, 0, 31}] (* Andres Cicuttin, Mar 27 2016 *)
    LinearRecurrence[{2,0,0,1,-2},{1,2,4,8,17},40] (* Harvey P. Dale, Apr 03 2018 *)
  • PARI
    Vec(1/((1-2*x)*(1-x^4))+O(x^99)) \\ Charles R Greathouse IV, May 15 2013
    
  • PARI
    a(n)=(16<Charles R Greathouse IV, Mar 27 2016
    
  • Python
    def A083593(n): return ((32<Chai Wah Wu, Apr 25 2025

Formula

a(n) = 2*a(n-1) + a(n-4) - 2*a(n-5).
If n is a multiple of 4, then a(n) = 2*a(n-1) + 1, otherwise a(n) = 2*a(n-1). - Gerald McGarvey, Oct 14 2008
a(n) = floor((2^(n+5) + 1)/30). - Tani Akinari, Jul 09 2013
From Andres Cicuttin, Mar 29 2016: (Start)
a(n) = 2*a(n-1) + floor(((n-1) mod 4)/3), with a(0)=1.
a(n) = 2*a(n-1) + 1 - ceiling((n mod 4)/4), with a(0)=1. (End)
15*a(n) = 2^(n+4) - A133145(n). - R. J. Mathar, Feb 27 2019
E.g.f.: (3*cos(x) - 5*cosh(x) + 32*cosh(2*x) + 6*sin(x) - 10*sinh(x) + 32*sinh(2*x))/30. - Stefano Spezia, Apr 25 2025

A300653 Square array T(n, k) (n >= 1, k >= 1) read by antidiagonals upwards: T(n, k) is the k-th positive number whose binary representation appears as a substring in the binary representation of 1/n (ignoring the radix point and adding trailing zeros if necessary in case of a terminating expansion).

Original entry on oeis.org

1, 1, 2, 1, 2, 4, 1, 2, 4, 8, 1, 2, 5, 8, 16, 1, 2, 4, 10, 16, 32, 1, 2, 3, 8, 21, 32, 64, 1, 2, 5, 4, 16, 42, 64, 128, 1, 2, 4, 10, 6, 32, 85, 128, 256, 1, 2, 4, 9, 21, 9, 64, 170, 256, 512, 1, 2, 3, 8, 18, 42, 12, 128, 341, 512, 1024, 1, 2, 3, 4, 16, 36, 85
Offset: 1

Views

Author

Rémy Sigrist, Mar 10 2018

Keywords

Examples

			Square array begins:
  n\k|    1    2    3    4    5    6    7    8    9   10
  ---+--------------------------------------------------
    1|    1    2    4    8   16   32   64  128  256  512  -->  A000079
    2|    1    2    4    8   16   32   64  128  256  512
    3|    1    2    5   10   21   42   85  170  341  682  -->  A000975
    4|    1    2    4    8   16   32   64  128  256  512
    5|    1    2    3    4    6    9   12   19   25   38
    6|    1    2    5   10   21   42   85  170  341  682
    7|    1    2    4    9   18   36   73  146  292  585  -->  A033138
    8|    1    2    4    8   16   32   64  128  256  512
    9|    1    2    3    4    6    7    8   12   14   17
   10|    1    2    3    4    6    9   12   19   25   38
		

Crossrefs

Programs

  • PARI
    See Links section.

Formula

T(n, 1) = 1.
T(n, 2) = 2.
T(n, 3) > 3 iff n belongs to A300630.
T(2*n, k) = T(n, k).
T(1, k) = A000079(k-1).
T(3, k) = A000975(k).
T(7, k) = A033138(k).
T(n, k) = k iff 1 <= k <= A300654(n).
T(n, k) = n for some k iff n belongs to A000079 or to A153055.

A078010 Expansion of (1-x)/(1 - x - x^2 - 2*x^3).

Original entry on oeis.org

1, 0, 1, 3, 4, 9, 19, 36, 73, 147, 292, 585, 1171, 2340, 4681, 9363, 18724, 37449, 74899, 149796, 299593, 599187, 1198372, 2396745, 4793491, 9586980, 19173961, 38347923, 76695844, 153391689, 306783379, 613566756, 1227133513, 2454267027, 4908534052
Offset: 0

Views

Author

N. J. A. Sloane, Nov 17 2002

Keywords

Comments

For n > 0, a(n) is the number of ways to tile a strip of length n with squares, dominoes, and two colors of trominoes, with the restriction that the first tile cannot be a square. - Greg Dresden and Bora Bursalı, Aug 31 2023

Examples

			a(6) = 19 = A077947(4) + 2*A077947(3) = 9 + 2*5 = 19.
G.f. = 1 + x^2 + 3*x^3 + 4*x^4 + 9*x^5 + 19*x^6 + 36*x^7 + 73*x^8 + ... - _Michael Somos_, Nov 18 2020
		

Crossrefs

Programs

  • GAP
    a:=[1,0,1];; for n in [4..50] do a[n]:=a[n-1]+a[n-2]+2*a[n-3]; od; a; # G. C. Greubel, Jun 28 2019
  • Magma
    R:=PowerSeriesRing(Integers(), 50); Coefficients(R!( (1-x)/(1-x-x^2-2*x^3) )); // G. C. Greubel, Jun 28 2019
    
  • Mathematica
    CoefficientList[Series[(1-x)/(1-x-x^2-2*x^3), {x,0,50}],x]  (* Harvey P. Dale, Mar 17 2011 *)
    LinearRecurrence[{1, 1, 2}, {1, 0, 1}, 50] (* Vladimir Joseph Stephan Orlovsky, Feb 24 2012 *)
  • PARI
    Vec((1-x)/(1-x-x^2-2*x^3)+O(x^50)) \\ Charles R Greathouse IV, Sep 26 2012
    
  • PARI
    {a(n) = ([0, 1, 1; 1, 1, 0; 0, 2, 0]^n)[1, 1]}; /* Michael Somos, Nov 18 2020 */
    
  • Sage
    ((1-x)/(1-x-x^2-2*x^3)).series(x, 50).coefficients(x, sparse=False) # G. C. Greubel, Jun 28 2019
    

Formula

a(0)=1, a(1)=0, a(2)=1, a(n) = a(n-1) + a(n-2) + 2*a(n-3) for n > 2. - Philippe Deléham, Sep 19 2006
a(n) + a(n+1) = A122552(n+1). - Philippe Deléham, Sep 25 2006
If p[1]=0, p[2]=1, p[i]=3, (i>2), and if A is Hessenberg matrix of order n defined by: A[i,j]=p[j-i+1], (i<=j), A[i,j]=-1, (i=j+1), and A[i,j]=0 otherwise. Then, for n >= 1, a(n)=det A. - Milan Janjic, May 02 2010
For n > 3, a(n) = A077947(n-2) + 2*A077947(n-3), with A077947 beginning (1, 2, 5, 9, 18, 37, ...); "1" has offset 1. - Gary W. Adamson, May 13 2013
a(n) = 2^(n-1) - 3*floor((2^(n-1))/7) - 1, for n >= 1. - Ridouane Oudra, Dec 02 2019
G.f.: (1 - x) / ((1 - 2*x) * (1 + x + x^2)). - Michael Somos, Nov 18 2020

A195904 Base-2 digits are, in order, the first n terms of the periodic sequence with initial period 1,0,0,0,0,0.

Original entry on oeis.org

1, 2, 4, 8, 16, 32, 65, 130, 260, 520, 1040, 2080, 4161, 8322, 16644, 33288, 66576, 133152, 266305, 532610, 1065220, 2130440, 4260880, 8521760, 17043521, 34087042, 68174084, 136348168, 272696336, 545392672, 1090785345, 2181570690, 4363141380, 8726282760
Offset: 1

Views

Author

Jeremy Gardiner, Sep 25 2011

Keywords

Comments

Here we let p = 6 to produce the above sequence, but p can be an arbitrary natural number. By letting p = 2, 3, 4, 7 we produce A000975, A033138, A083593 and A117302. We denote by U(p,n,m) the number of cases in which the first player is killed in a Russian roulette game when p players use a gun with n chambers and m bullets. They never rotate the cylinder after the game starts. The chambers can be represented by the list {1,2,...,n}.
We are going to calculate the following (0), (1), ..., (t) separately. (0) The first player is killed when one bullet is in the first chamber and the remaining (m-1) bullets are in {2,3,...,n}. We have binomial(n-1,m-1) cases for this. (1) The first is killed when one bullet is in the (p+1)th chamber and the rest of the bullets are in {p+2,..,n}. We have binomial(n-p-1,m-1) cases for this. We continue to calculate and the last is (t), where t = floor((n-m)/p). (t) The first is killed when one bullet is in the (pt+1)-th chamber and the remaining bullets are in {pt+2,...,n}. We have binomial(n-pt-1,m-1) cases for this. Therefore U(p,n,m) = Sum_{z=0..floor((n-m)/p)} binomial(n-pz-1,m-1). Let A(p,n) be the number of cases in which the first player is killed when p players use a gun with n chambers and the number of the bullets can be from 1 to n. Then A(p,n) = Sum_{m=1..n} U(p,n,m). - Ryohei Miyadera, Tomohide Hashiba, Yuta Nakagawa, Hiroshi Matsui, Jun 04 2006

Crossrefs

Programs

  • Mathematica
    U[p_, n_, m_, v_]:=Block[{t}, t=Floor[(1+p-m+n-v)/p]; Sum[Binomial[n - v - p*z, m - 1], {z, 0, t - 1}]]; A[p_, n_, v_]:=Sum[U[p, n, k, v], {k, 1, n}]; (* Here we let p = 6 to produce the above sequence, but this code can produce A000975, A033138, A083593, A117302 for p = 2, 3, 4, 7. *) Table[A[6, n, 1], {n, 1, 20}] (* Ryohei Miyadera, Tomohide Hashiba, Yuta Nakagawa, Hiroshi Matsui, Jun 04 2006 *)
    Rest[CoefficientList[Series[x/(2*x^7 - x^6 - 2*x + 1), {x, 0, 50}], x]] (* G. C. Greubel, Sep 28 2017 *)
  • PARI
    x='x+O('x^50); Vec(x/(2*x^7 - x^6 - 2*x + 1)) \\ G. C. Greubel, Sep 28 2017

Formula

From Colin Barker, Jun 09 2013: (Start)
a(n) = floor(2^(n+5)/63).
G.f.: x /(2*x^7 - x^6 - 2*x +1).
G.f.: x /((x-1)*(x+1)*(2*x-1)*(x^2-x+1)*( x^2+x+1)). (End)

Extensions

More terms from Colin Barker, Jun 09 2013

A300428 a(n) is the least positive k such that the binary representation of n appears as a substring in the binary representation of 1/k (ignoring the radix point and adding trailing zeros if necessary in case of a terminating expansion).

Original entry on oeis.org

1, 1, 5, 1, 3, 5, 9, 1, 5, 3, 11, 5, 11, 9, 17, 1, 9, 7, 5, 11, 3, 13, 11, 9, 5, 11, 13, 9, 11, 17, 33, 1, 17, 11, 9, 7, 19, 5, 13, 11, 29, 3, 19, 13, 27, 11, 19, 17, 9, 19, 5, 11, 19, 13, 29, 9, 19, 11, 13, 17, 25, 33, 65, 1, 33, 23, 17, 13, 11, 29, 9, 23, 7
Offset: 1

Views

Author

Rémy Sigrist, Mar 05 2018

Keywords

Comments

In other words, a(n) is the least k > 0 such that floor((2^i) / k) mod A062383(n) = n for some integer i >= 0.
This sequence is similar to A035335 for the base 2.
All terms are odd.
All terms appears infinitely many times (as a(n) equals at least a(2*n) or a(2*n + 1)).
See also A300475 for a similar sequence.

Examples

			The first terms, alongside the binary representation of 1/a(n) with the earliest occurrence of the binary representation of n in parentheses, are:
  n  a(n)    bin(1/a(n))
  -- ----    -----------
   1    1    (1).000...
   2    1    (1.0)000...
   3    5    0.00(11)001...
   4    1    (1.00)000...
   5    3    0.0(101)010...
   6    5    0.00(110)011...
   7    9    0.000(111)000...
   8    1    (1.000)000...
   9    5    0.001(1001)100...
  10    3    0.0(1010)101...
  11   11    0.000(1011)101...
  12    5    0.00(1100)110...
  13   11    0.000101(1101)000...
  14    9    0.000(1110)001...
  15   17    0.0000(1111)000...
  16    1    (1.0000)000...
  17    9    0.00011(10001)110...
  18    7    0.00(10010)010...
  19    5    0.001(10011)001...
  20   11    0.0001011(10100)010...
		

Crossrefs

Programs

  • PARI
    See Links section.

Formula

a(2^k) = 1 for any k >= 0.
a(2^k - 1) = 2^k + 1 for any k > 1.
a(A000975(k)) = 3 for any k > 2.
a(A033138(k)) = 7 for any k > 4.
a(n) <= A300475(n) for any n > 0.

A300475 a(n) is the least positive k such that the binary representation n appears in front of the binary representation of 1/k (ignoring the radix point and the leading zeros and adding trailing zeros if necessary in case of a terminating expansion).

Original entry on oeis.org

1, 1, 5, 1, 3, 5, 9, 1, 7, 3, 11, 5, 19, 9, 17, 1, 15, 7, 13, 25, 3, 23, 11, 21, 5, 19, 37, 9, 35, 17, 33, 1, 31, 15, 29, 7, 27, 53, 13, 25, 49, 3, 47, 23, 45, 11, 43, 21, 41, 81, 5, 39, 19, 75, 37, 9, 71, 35, 69, 17, 67, 33, 65, 1, 63, 31, 61, 15, 59, 29, 57
Offset: 1

Views

Author

Rémy Sigrist, Mar 06 2018

Keywords

Comments

In other words, a(n) is the least k > 0 such that floor((2^i) / k) = n for some integer i >= 0.
This sequence is similar to A095156 for the base 2.
All terms are odd.
All terms appears infinitely many times (as a(n) equals at least a(2*n) or a(2*n + 1)).
See also A300428 for a similar sequence.

Examples

			The first terms, alongside the binary representation of 1/a(n) with the earliest occurrence of the binary representation of n in parentheses, are:
  n  a(n)    bin(1/a(n))
  -- ----    -----------
   1    1    (1).000...
   2    1    (1.0)000...
   3    5    0.00(11)001...
   4    1    (1.00)000...
   5    3    0.0(101)010...
   6    5    0.00(110)011...
   7    9    0.000(111)000...
   8    1    (1.000)000...
   9    7    0.00(1001)001...
  10    3    0.0(1010)101...
  11   11    0.000(1011)101...
  12    5    0.00(1100)110...
  13   19    0.0000(1101)011...
  14    9    0.000(1110)001...
  15   17    0.0000(1111)000...
  16    1    (1.0000)000...
  17   15    0.000(10001)000...
  18    7    0.00(10010)010...
  19   13    0.000(10011)101...
  20   25    0.0000(10100)011...
		

Crossrefs

Programs

  • PARI
    See Links section.

Formula

a(2^k) = 1 for any k >= 0.
a(2^k - 1) = 2^k + 1 for any k > 1.
a(A000975(k)) = 3 for any k > 2.
a(A033138(k)) = 7 for any k > 4.
a(n) >= A300428(n).

A101351 a(n) = 2^n-1 + Fibonacci(n).

Original entry on oeis.org

2, 4, 9, 18, 36, 71, 140, 276, 545, 1078, 2136, 4239, 8424, 16760, 33377, 66522, 132668, 264727, 528468, 1055340, 2108097, 4212014, 8417264, 16823583, 33629456, 67230256, 134414145, 268753266, 537385140, 1074573863, 2148829916, 4297145604, 8593459169
Offset: 1

Views

Author

Jorge Coveiro, Dec 25 2004

Keywords

Crossrefs

Programs

  • Maple
    seq(2^x-1+fibonacci(x),x=1..30);
  • Mathematica
    Table[2^n-1+Fibonacci[n],{n,30}] (* or *) LinearRecurrence[{4,-4,-1,2},{2,4,9,18},30] (* Harvey P. Dale, Aug 24 2012 *)
  • PARI
    Vec(x*(2-4*x+x^2)/((1-x)*(1-2*x)*(1-x-x^2)) + O(x^30)) \\ Colin Barker, Nov 02 2016
  • Sage
    [gaussian_binomial(n,1,2)+fibonacci (n) for n in range(1,31)] # Zerinvary Lajos, May 29 2009
    

Formula

a(n) = 4*a(n-1) -4*a(n-2) -a(n-3) +2*a(n-4). G.f.: x*(2-4*x+x^2)/((x-1) * (2*x-1) * (1-x-x^2)). - R. J. Mathar, Feb 06 2010
a(n) = ((1+sqrt(5))^n-(1-sqrt(5))^n)/(2^n*sqrt(5)) + 2^n - 1. - Colin Barker, Nov 02 2016

Extensions

Offset changed to 1 by Colin Barker, Nov 02 2016
Showing 1-10 of 13 results. Next