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

A061561 Trajectory of 22 under the Reverse and Add! operation carried out in base 2.

Original entry on oeis.org

22, 35, 84, 105, 180, 225, 360, 405, 744, 837, 1488, 1581, 3024, 3213, 6048, 6237, 12192, 12573, 24384, 24765, 48960, 49725, 97920, 98685, 196224, 197757, 392448, 393981, 785664, 788733, 1571328, 1574397, 3144192, 3150333, 6288384, 6294525
Offset: 0

Views

Author

N. J. A. Sloane, May 18 2001

Keywords

Comments

Sequence A058042 written in base 10. 22 is the smallest number whose base 2 trajectory does not contain a palindrome.
lim_{n -> infinity} a(n)/a(n-1) = 2 for n mod 2 = 0.
lim_{n -> infinity} a(n)/a(n-1) = 1 for n mod 2 = 1. - Klaus Brockhaus, Dec 09 2009

Crossrefs

Cf. A035522 (trajectory of 1 in base 2), A058042 (trajectory of 22 in base 2, written in base 2), A075253 (trajectory of 77 in base 2), A075268 (trajectory of 442 in base 2), A077076 (trajectory of 537 in base 2), A077077 (trajectory of 775 in base 2), A066059 (trajectory of n in base 2 (presumably) does not reach a palindrome), A075252 (trajectory of n in base 2 does not reach a palindrome and (presumably) does not join the trajectory of any term m < n), A075153 (trajectory of 318 in base 4).
Cf. A171470 (a(4*n)/2), A171471 (a(4*n+1)), A171472 (a(4*n+2)/12), A171473 (a(4*n+3)/3).

Programs

  • ARIBAS
    m := 22; stop := 36; c := 0; while c < stop do write(m,","); k := bit_length(m); rev := 0; for i := 0 to k-1 do if bit_test(m,i) then rev := bit_set(rev,k-1-i); end; end; inc(c); m := m+rev; end;.
    
  • Haskell
    a061561 n = a061561_list !! n
    a061561_list = iterate a055944 22  -- Reinhard Zumkeller, Apr 21 2013
  • Magma
    trajectory:=function(init, steps, base) a:=init; S:=[a]; for n in [1..steps] do a+:=Seqint(Reverse(Intseq(a,base)),base); Append(~S, a); end for; return S; end function; trajectory(22, 35, 2); // Klaus Brockhaus, Dec 09 2009
    
  • Mathematica
    binRA[n_] := If[Reverse[IntegerDigits[n, 2]] == IntegerDigits[n, 2], n, FromDigits[Reverse[IntegerDigits[n, 2]], 2] + n]; NestList[binRA, 22, 100] (* Adapted from Ben Branman's code for A213012, Alonso del Arte, Jun 02 2012 *)
  • PARI
    {m=22; stop=36; c=0; while(c0,d=divrem(k,2); k=d[1]; rev=2*rev+d[2]); c++; m=m+rev)}
    

Formula

a(0) = 22; a(1) = 35; for n > 1 and n = 2 (mod 4): a(n) = 6*2^(2*k)-3*2^k where k = (n+6)/4; n = 3 (mod 4): a(n) = 6*2^(2*k)+3*2^k-3 where k = (n+5)/4; n = 0 (mod 4): a(n) = 12*2^(2*k)-3*2^k where k = (n+4)/4; n = 1 (mod 4): a(n) = 12*2^(2*k)+9*2^k-3 where k = (n+3)/4. [Klaus Brockhaus, Sep 05 2002]
G.f.: (22+35*x+18*x^2-72*x^4-90*x^5-48*x^6-60*x^7+80*x^8+112*x^9) / ((1-x)*(1+x)*(1-2*x^2)*(1-2*x^4)). [Klaus Brockhaus, Sep 05 2002, edited Dec 09 2009]
a(n+1) = A055944(a(n)). - Reinhard Zumkeller, Apr 21 2013

Extensions

More terms from Klaus Brockhaus, May 27 2001

A075253 Trajectory of 77 under the Reverse and Add! operation carried out in base 2.

Original entry on oeis.org

77, 166, 267, 684, 897, 1416, 1557, 2904, 3333, 5904, 6189, 11952, 12813, 24096, 24669, 48480, 50205, 97344, 98493, 195264, 198717, 391296, 393597, 783744, 790653, 1569024, 1573629, 3140352, 3154173, 6283776, 6292989, 12572160
Offset: 0

Views

Author

Klaus Brockhaus, Sep 10 2002

Keywords

Comments

22 is the smallest number whose base 2 trajectory (A061561) provably does not contain a palindrome. 77 is the next number (cf. A075252) with a completely different trajectory which has this property. A proof along the lines of Klaus Brockhaus, On the 'Reverse and Add!' algorithm in base 2, can be based on the formula given below.
lim_{n -> infinity} a(n)/a(n-1) = 2 for n mod 2 = 1.
lim_{n -> infinity} a(n)/a(n-1) = 1 for n mod 2 = 0.
Interleaving of A176632, 2*A176633, 3*A176634, 12*A176635.
From A.H.M. Smeets, Feb 11 2019: (Start)
Pattern with cycle length 4 in binary representation, represented by contextfree grammars with production rules:
S_a -> 10 T_a 00, T_a -> 1 T_a 0 | 1100010;
S_b -> 11 T_b 01, T_b -> 0 T_b 1 | 0000101;
S_c -> 10 T_c 000, T_c -> 1 T_c 0 | 1101011;
S_d -> 11 T_d 101, T_d -> 0 T_d 1 | 0100000;
the trajectory is similar to that of 22 (see A058042) except for the stopping strings in T_a, T_b, T_c and T_d. (End)

Examples

			267 (decimal) = 100001011 -> 100001011 + 110100001 = 1010101100 = 684 (decimal).
		

Crossrefs

Cf. A061561 (trajectory of 22 in base 2), A075268 (trajectory of 442 in base 2), A077076 (trajectory of 537 in base 2), A077077 (trajectory of 775 in base 2), A066059 (trajectory of n in base 2 presumably does not reach a palindrome), A075252 (trajectory of n in base 2 does not reach a palindrome and presumably does not join the trajectory of any term m < n), A092210 (trajectory of n in base 2 presumably does not join the trajectory of any m < n).
Cf. A176632 (a(4*n)), A176633 (a(4*n+1)/2), A176634 (a(4*n+2)/3), A176635 (a(4*n+3)/12).

Programs

  • Haskell
    a075253 n = a075253_list !! n
    a075253_list = iterate a055944 77  -- Reinhard Zumkeller, Apr 21 2013
    
  • Magma
    trajectory:=function(init, steps, base) S:=[init]; a:=S[1]; for n in [1..steps] do a+:=Seqint(Reverse(Intseq(a,base)),base); Append(~S, a); end for; return S; end function; trajectory(77, 31, 2);
    
  • Maple
    seq(coeff(series((77+166*x+36*x^2+186*x^3+96*x^4-636*x^5-672*x^6-348*x^7-44*x^8+632*x^9+504*x^10)/((1-x)*(1+x)*(1-2*x^2)*(1-2*x^4)),x,n+1), x, n), n = 0 .. 40); # Muniru A Asiru, Feb 12 2019
  • Mathematica
    CoefficientList[Series[(77+166*x+36*x^2+186*x^3+96*x^4-636*x^5-672*x^6 -348*x^7-44*x^8 +632*x^9+504*x^10)/((1-x)*(1+x)*(1-2*x^2)*(1-2*x^4)), {x,0,40}], x] (* G. C. Greubel, Feb 11 2019 *)
    NestWhileList[# + IntegerReverse[#, 2] &, 77,  # !=
    IntegerReverse[#, 2] &, 1, 31] (* Robert Price, Oct 18 2019 *)
  • PARI
    {m=77; stop=34; c=0; while(c0,d=divrem(k,2); k=d[1]; rev=2*rev+d[2]); c++; m=m+rev)}
    
  • Sage
    ((77+166*x+36*x^2+186*x^3+96*x^4-636*x^5-672*x^6 -348*x^7-44*x^8 +632*x^9+504*x^10)/((1-x)*(1+x)*(1-2*x^2)*(1-2*x^4))).series(x, 40).coefficients(x, sparse=False) # G. C. Greubel, Feb 11 2019

Formula

a(0) = 77; a(1) = 166; a(2) = 267; for n > 2 and
n = 3 (mod 4): a(n) = 48*2^(2*k)-21*2^k where k = (n+5)/4;
n = 0 (mod 4): a(n) = 48*2^(2*k)+33*2^k-3 where k = (n+4)/4;
n = 1 (mod 4): a(n) = 96*2^(2*k)-30*2^k where k = (n+3)/4;
n = 2 (mod 4): a(n) = 96*2^(2*k)+6*2^k-3 where k = (n+2)/4.
G.f.: (77+166*x+36*x^2+186*x^3+96*x^4-636*x^5-672*x^6-348*x^7-44*x^8 +632*x^9+504*x^10) / ((1-x)*(1+x)*(1-2*x^2)*(1-2*x^4)).
G.f. for the sequence starting at a(3): 3*x^3*(228+299*x-212*x^2 -378*x^3-448*x^4-446*x^5+432*x^6+524*x^7) / ((1-x)*(1+x)*(1-2*x^2)*(1-2*x^4)).
a(n+1) = A055944(a(n)). - Reinhard Zumkeller, Apr 21 2013

Extensions

Three comments added, g.f. edited, MAGMA program and crossrefs added by Klaus Brockhaus, Apr 25 2010

A077077 Trajectory of 775 under the Reverse and Add! operation carried out in base 2, written in base 10.

Original entry on oeis.org

775, 1674, 2325, 5022, 8919, 23976, 26757, 47376, 49581, 96048, 102669, 193056, 197469, 388704, 401949, 779328, 788157, 1563840, 1590333, 3131520, 3149181, 6273408, 6326397, 12554496, 12589821, 25129728, 25235709, 50274816, 50345469
Offset: 0

Views

Author

Klaus Brockhaus, Oct 25 2002

Keywords

Comments

The base 2 trajectory of 775 = A075252(5) provably does not contain a palindrome. A proof can be based on the formula given below.
lim_{n -> infinity} a(n)/a(n-1) = 1 for n mod 2 = 1.
lim_{n -> infinity} a(n)/a(n-1) = 2 for n mod 2 = 0.
Interleaving of A177843, 6*A177844, 3*A177845, 6*A177846.

Examples

			775 (decimal) = 1100000111 -> 1100000111 + 1110000011 = 11010001010 = 1674 (decimal).
		

Crossrefs

Cf. A058042 (trajectory of 22 in base 2, written in base 2), A061561 (trajectory of 22 in base 2), A075253 (trajectory of 77 in base 2), A075268 (trajectory of 442 in base 2), A077076 (trajectory of 537 in base 2), A075252 (trajectory of n in base 2 does not reach a palindrome and (presumably) does not join the trajectory of any term m < n).
Cf. A177843 (a(4*n)), A177844 (a(4*n+1)/6), A177845 (a(4*n+2)/3), A177846 (a(4*n+3)/6).

Programs

  • Haskell
    a077077 n = a077077_list !! n
    a077077_list = iterate a055944 775  -- Reinhard Zumkeller, Apr 21 2013
  • Magma
    trajectory:=function(init, steps, base) a:=init; S:=[a]; for n in [1..steps] do a+:= Seqint(Reverse(Intseq(a,base)),base); Append(~S, a); end for; return S; end function; trajectory(775, 28, 2);
    
  • Mathematica
    NestWhileList[# + IntegerReverse[#, 2] &, 775,  # !=
    IntegerReverse[#, 2] &, 1, 28] (* Robert Price, Oct 18 2019 *)
  • PARI
    trajectory(n,steps) = {local(v, k=n); for(j=0, steps, print1(k, ", "); v=binary(k); k+=sum(j=1, #v, 2^(j-1)*v[j]))};
    trajectory(775,28);
    

Formula

a(0), ..., a(5) as above; for n > 5 and
n = 2 (mod 4): a(n) = 3*2^(2*k+7)+273*2^k-3 where k = (n+6)/4;
n = 3 (mod 4): a(n) = 6*2^(2*k+7)-222*2^k where k = (n+5)/4;
n = 0 (mod 4): a(n) = 6*2^(2*k+7)+54*2^k-3 where k = (n+4)/4;
n = 1 (mod 4): a(n) = 12*2^(2*k+7)-282*2^k where k = (n+3)/4.
a(n) = -a(n-1)+2*a(n-2)+2*a(n-3)+2*a(n-4)+2*a(n-5)-4*a(n-6)-4*a(n-7)-3 for n > 12; a(0), ..., a(12) as above.
G.f.: (775+1674*x+1944*x^4+8910*x^5+4650*x^6-14508*x^7-19840*x^8-22644*x^9- 1860*x^10+28680*x^11+14328*x^12-2112*x^13) / ((1-x)*(1+x)*(1-2*x^2)*(1-2*x^4)).
G.f. for the sequence starting at a(6): 3*(8919+15792*x-10230*x^2- 15360*x^3-15358*x^4-31696*x^5+16668*x^6+31264*x^7) / ((1-x)*(1+x)*(1-2*x^2)*(1-2*x^4)).
a(n+1) = A055944(a(n)). - Reinhard Zumkeller, Apr 21 2013

Extensions

Comment edited, three comments and formula added, g.f. edited, PARI program revised, MAGMA program and crossrefs added by Klaus Brockhaus, May 14 2010

A177682 a(n) = 6*a(n-1)-8*a(n-2)-3 for n > 4; a(0)=179, a(1)=1571, a(2)=12511, a(3)=155403, a(4)=572951.

Original entry on oeis.org

179, 1571, 12511, 155403, 572951, 2194479, 8583263, 33943743, 134996351, 538428159, 2150598143, 8596163583, 34372196351, 137463869439, 549805645823, 2199122919423, 8796292349951, 35184770744319, 140738285666303
Offset: 0

Views

Author

Klaus Brockhaus, May 12 2010

Keywords

Comments

Related to Reverse and Add trajectory of 537 in base 2: a(n) = A077076(4*n)/3, i.e. one third of first quadrisection of A077076.

Crossrefs

Cf. A077076 (Reverse and Add trajectory of 537 in base 2), A177683, A177684, A177685.

Programs

  • Magma
    [179, 1571, 12511] cat [2*4^(n+5)+6083*2^(n-1)-1: n in [3..25]]; // Vincenzo Librandi, Sep 24 2013
  • Mathematica
    Join[{179,1571,12511},LinearRecurrence[{7,-14,8},{155403,572951,2194479},20]] (* Harvey P. Dale, Oct 06 2011 *)
    CoefficientList[Series[(179 + 318 x + 4020 x^2 + 88388 x^3 - 352284 x^4 + 259376 x^5)/((1 - x) (1 - 2 x) (1 - 4 x)), {x, 0, 40}], x] (* Vincenzo Librandi, Sep 24 2013 *)
  • PARI
    {m=19; v=concat([179, 1571, 12511, 155403, 572951], vector(m-5)); for(n=6 ,m, v[n]=6*v[n-1]-8*v[n-2]-3); v}
    

Formula

a(n) = 2*4^(n+5)+6083*2^(n-1)-1 for n > 2.
G.f.: (179+318*x+4020*x^2+88388*x^3-352284*x^4+259376*x^5) / ((1-x)*(1-2*x)*(1-4*x)).
G.f. for the sequence starting at a(3): x^3*(155403-514870*x+359464*x^2) / ((1-x)*(1-2*x)*(1-4*x)).

A177683 a(n) = 6*a(n-1)-8*a(n-2) for n > 4; a(0)=191, a(1)=1587, a(2)=14161, a(3)=123004, a(4)=508152.

Original entry on oeis.org

191, 1587, 14161, 123004, 508152, 2064880, 8324064, 33425344, 133959552, 536354560, 2146450944, 8587869184, 34355607552, 137430691840, 549739290624, 2198990209024, 8796026929152, 35184239902720, 140737223983104
Offset: 0

Views

Author

Klaus Brockhaus, May 12 2010

Keywords

Comments

Related to Reverse and Add trajectory of 537 in base 2: a(n) = A077076(4*n+1)/6, i.e., one sixth of second quadrisection of A077076.

Crossrefs

Cf. A077076 (Reverse and Add trajectory of 537 in base 2), A177682, A177684, A177685.

Programs

  • Magma
    [191, 1587, 14161] cat [2*4^(n+5)-2017*2^(n-1): n in [3..25]]; // Vincenzo Librandi, Sep 24 2013
  • Mathematica
    Join[{191,1587,14161},Transpose[NestList[{Last[#],6Last[#]-8First[#]}&,{123004,508152},20]][[1]]]  (* Harvey P. Dale, Mar 06 2011 *)
    CoefficientList[Series[(191 + 441 x + 6167 x^2 + 50734 x^3 - 116584 x^4)/((1 - 2 x) (1 - 4 x)), {x, 0, 40}], x] (* Vincenzo Librandi, Sep 24 2013 *)
    LinearRecurrence[{6,-8},{191,1587,14161,123004,508152},20] (* Harvey P. Dale, Oct 16 2019 *)
  • PARI
    {m=19; v=concat([191, 1587, 14161, 123004, 508152], vector(m-5)); for(n=6 ,m, v[n]=6*v[n-1]-8*v[n-2]); v}
    

Formula

a(n) = 2*4^(n+5)-2017*2^(n-1) for n > 2.
G.f.: (191+441*x+6167*x^2+50734*x^3-116584*x^4) / ((1-2*x)*(1-4*x)).
G.f. for the sequence starting at a(3): 4*x^3*(30751-57468*x) / ((1-2*x)*(1-4*x)).

A177684 a(n) = 6*a(n-1)-8*a(n-2)-3 for n > 4; a(0)=633, a(1)=4809, a(2)=46041, a(3)=277767, a(4)=1079823.

Original entry on oeis.org

633, 4809, 46041, 277767, 1079823, 4256799, 16902207, 67358847, 268935423, 1074741759, 4296967167, 17183868927, 68727476223, 274893905919, 1099543625727, 4398110507007, 17592314036223, 70369000161279
Offset: 0

Views

Author

Klaus Brockhaus, May 12 2010

Keywords

Comments

Related to Reverse and Add trajectory of 537 in base 2: a(n) = A077076(4*n+2)/3, i.e., one third of third quadrisection of A077076.

Crossrefs

Cf. A077076 (Reverse and Add trajectory of 537 in base 2), A177682, A177683, A177685.

Programs

  • Magma
    [633, 4809, 46041] cat [4^(n+6)+1953*2^n-1: n in [3..25]]; // Vincenzo Librandi, Sep 24 2013
  • Mathematica
    Join[{633,4809,46041},RecurrenceTable[{a[3]==277767,a[4]==1079823,a[n] == 6a[n-1]-8a[n-2]-3},a,{n,20}]] (* or *) Join[{633,4809,46041}, LinearRecurrence[ {7,-14,8},{277767,1079823,4256799},18]] (* Harvey P. Dale, May 03 2012 *)
    CoefficientList[Series[3 (211 + 126 x + 7080 x^2 + 5914 x^3 - 86148 x^4 + 72816 x^5)/((1 - x) (1 - 2 x) (1 - 4 x)), {x, 0, 40}], x] (* Vincenzo Librandi, Sep 24 2013 *)
  • PARI
    {m=18; v=concat([633, 4809, 46041, 277767, 1079823], vector(m-5)); for(n=6 ,m, v[n]=6*v[n-1]-8*v[n-2]-3); v}
    

Formula

a(n) = 4^(n+6)+1953*2^n-1 for n > 2.
G.f.: 3*(211+126*x+7080*x^2+5914*x^3-86148*x^4+72816*x^5) / ((1-x)*(1-2*x)*(1-4*x)).
G.f. for the sequence starting at a(3): 3*x^3*(92589-288182*x+195592*x^2) / ((1-x)*(1-2*x)*(1-4*x)).
a(0)=633, a(1)=4809, a(2)=46041, a(3)=277767, a(4)=1079823, a(5)=4256799, a(n)=7*a(n-1)-14*a(n-2)+8*a(n-3). - Harvey P. Dale, May 03 2012

A177685 a(n) = 6*a(n-1)-8*a(n-2) for n > 4; a(0)=603, a(1)=4731, a(2)=58834, a(3)=254204, a(4)=1032696.

Original entry on oeis.org

603, 4731, 58834, 254204, 1032696, 4162544, 16713696, 66981824, 268181376, 1073233664, 4293950976, 17177836544, 68715411456, 274869776384, 1099495366656, 4398013988864, 17592120999936, 70368614088704
Offset: 0

Views

Author

Klaus Brockhaus, May 12 2010

Keywords

Comments

Related to Reverse and Add trajectory of 537 in base 2: a(n) = A077076(4*n+3)/6, i.e., one sixth of fourth quadrisection of A077076.

Crossrefs

Cf. A077076 (Reverse and Add trajectory of 537 in base 2), A177682, A177683, A177684.

Programs

  • Magma
    [603, 4731, 58834] cat [4^(n+6)-1985*2^(n-1): n in [3..25]]; // Vincenzo Librandi, Sep 24 2013
  • Mathematica
    CoefficientList[Series[(603 + 1113 x + 35272 x^2 - 60952 x^3 - 21856 x^4)/((1 - 2 x) (1 - 4 x)), {x, 0, 40}], x] (* Vincenzo Librandi, Sep 24 2013 *)
    LinearRecurrence[{6,-8},{603,4731,58834,254204,1032696},20] (* Harvey P. Dale, May 26 2019 *)
  • PARI
    {m=18; v=concat([603, 4731, 58834, 254204, 1032696], vector(m-5)); for(n=6 ,m, v[n]=6*v[n-1]-8*v[n-2]); v}
    

Formula

a(n) = 4^(n+6)-1985*2^(n-1) for n > 2.
G.f.: (603+1113*x+35272*x^2-60952*x^3-21856*x^4) / ((1-2*x)*(1-4*x)).
G.f. for the sequence starting at a(3): 4*x^3*(63551-123132*x) / ((1-2*x)*(1-4*x)).

A213012 Trajectory of 26 under the Reverse and Add! operation carried out in base 2.

Original entry on oeis.org

26, 37, 78, 135, 360, 405, 744, 837, 1488, 1581, 3024, 3213, 6048, 6237, 12192, 12573, 24384, 24765, 48960, 49725, 97920, 98685, 196224, 197757, 392448, 393981, 785664, 788733, 1571328, 1574397, 3144192, 3150333
Offset: 0

Views

Author

Ben Branman, Jun 01 2012

Keywords

Comments

26 is the second-smallest number (after 22) whose base 2 trajectory does not contain a palindrome.
lim_{n -> infinity} a(n)/a(n-1) = 2 for n mod 2 = 0.
lim_{n -> infinity} a(n)/a(n-1) = 1 for n mod 2 = 1. - Branman
In 2001, Brockhaus proved that if the binary Reverse and Add trajectory of an integer contains an integer of one of four specific given forms, then the trajectory never reaches a palindrome. In the case of 26, that would be 3(2^(2k + 1) - 2^k), with k = 3 corresponding to 360. - Alonso del Arte, Jun 02 2012

Examples

			In binary, 26 is 11010.
a(1) = 37 because 11010 + 01011 = 100101, or 37.
a(2) = 78 because 100101 + 101001 = 1001110, or 78.
		

Crossrefs

Programs

  • Mathematica
    binRA[n_] := If[Reverse[IntegerDigits[n, 2]] == IntegerDigits[n, 2], n, FromDigits[Reverse[IntegerDigits[n, 2]], 2] + n]; NestList[binRA, 26, 100]
Showing 1-8 of 8 results.