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

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

Original entry on oeis.org

537, 1146, 1899, 3618, 4713, 9522, 14427, 28386, 37533, 84966, 138123, 353004, 466209, 738024, 833301, 1525224, 1718853, 3048912, 3239469, 6196176, 6583437, 12389280, 12770397, 24975264, 25749789, 49944384, 50706621, 100282176
Offset: 0

Views

Author

Klaus Brockhaus, Oct 25 2002

Keywords

Comments

The base 2 trajectory of 537 = A075252(4) 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 3*A177682, 6*A177683, 3*A177684, 6*A177685.

Examples

			537 (decimal) = 1000011001 -> 1000011001 + 1001100001 = 10001111010= 1146 (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), A077077 (trajectory of 775 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. A177682 (a(4*n)/3), A177683 (a(4*n+1)/6), A177684 (a(4*n+2)/3), A177685 (a(4*n+3)/6).

Programs

  • Haskell
    a077076 n = a077076_list !! n
    a077076_list = iterate a055944 537  -- 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(537, 27, 2);
    
  • Mathematica
    NestWhileList[# + IntegerReverse[#, 2] &, 537,  # !=
    IntegerReverse[#, 2] &, 1, 27] (* 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(537,27);
    

Formula

a(0), ..., a(11) as above; for n > 11 and
n = 0 (mod 4): a(n) = 3*2^(2*k+13)+18249*2^k-3 where k = (n-4)/4;
n = 1 (mod 4): a(n) = 6*2^(2*k+13)-12102*2^k where k = (n-5)/4;
n = 2 (mod 4): a(n) = 6*2^(2*k+13)+11718*2^k-3 where k = (n-6)/4;
n = 3 (mod 4): a(n) = 12*2^(2*k+13)-11910*2^k where k = (n-7)/4.
G.f.: 3*(179+382*x+96*x^2+60*x^3-328*x^4-444*x^5+1170*x^6+2232*x^7 +1166*x^8+5644*x^9+15402*x^10+46922*x^11+39850*x^12-62920*x^13-132612*x^14 -97532*x^15-34148*x^16+83800*x^17+109224*x^18+21856*x^19) / ((1-x)*(1+x)*(1-2*x^2)*(1-2*x^4)).
G.f. for the sequence starting at a(12): 3*x^12*(155403+246008*x-188442*x^2-229616*x^3-260350*x^4-508920*x^5+293388*x^6+492528*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 and three comments added, g.f. edited, PARI program revised, MAGMA program and crossrefs added by Klaus Brockhaus, May 12 2010

A177843 a(n) = 6*a(n-1)-8*a(n-2)-9 for n > 3; a(0)=775, a(1)=8919, a(2)=49581, a(3)=197469.

Original entry on oeis.org

775, 8919, 49581, 197469, 788157, 3149181, 12589821, 50345469, 201354237, 805361661, 3221336061, 12885123069, 51540049917, 206159314941, 824635490301, 3298538422269, 13194146611197, 52776572289021, 211106260844541
Offset: 0

Views

Author

Klaus Brockhaus, May 14 2010

Keywords

Comments

Related to Reverse and Add trajectory of 775 in base 2: a(n) = A077077(4*n), i.e. first quadrisection of A077077.

Crossrefs

Cf. A077077 (Reverse and Add trajectory of 775 in base 2), A177844, A177845, A177846.

Programs

  • Magma
    [775, 8919] cat [3*4^(n+5)+27*2^(n+2)-3: n in [2..25]]; // Vincenzo Librandi, Sep 24 2013
  • Mathematica
    CoefficientList[Series[(775 + 3494 x - 2002 x^2 - 30932 x^3 + 28656 x^4)/((1 - x) (1 - 2 x) (1 - 4 x)), {x, 0, 40}], x] (* Vincenzo Librandi, Sep 24 2013 *)
    LinearRecurrence[{7,-14,8},{775,8919,49581,197469,788157},20] (* Harvey P. Dale, Aug 03 2023 *)
  • PARI
    {m=19; v=concat([775, 8919, 49581, 197469], vector(m-4)); for(n=5, m, v[n]=6*v[n-1]-8*v[n-2]-9); v}
    

Formula

a(n) = 3*4^(n+5)+27*2^(n+2)-3 for n > 1.
G.f.: (775+3494*x-2002*x^2-30932*x^3+28656*x^4) / ((1-x)*(1-2*x)*(1-4*x)).
G.f. for the sequence starting at a(2): 9*x^2*(5509-16622*x+11112*x^2) / ((1-x)*(1-2*x)*(1-4*x)).

A177844 a(n) = 6*a(n-1)-8*a(n-2) for n > 3; a(0)=279, a(1)=3996, a(2)=16008, a(3)=64784.

Original entry on oeis.org

279, 3996, 16008, 64784, 260640, 1045568, 4188288, 16765184, 67084800, 268387328, 1073645568, 4294774784, 17179484160, 68718706688, 274876366848, 1099508547584, 4398040350720, 17592173723648, 70368719536128
Offset: 0

Views

Author

Klaus Brockhaus, May 14 2010

Keywords

Comments

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

Crossrefs

Cf. A077077 (Reverse and Add trajectory of 775 in base 2), A177843, A177845, A177846.

Programs

  • Magma
    [279, 3996] cat [4^(n+5)-47*2^(n+1): n in [2..25]]; // Vincenzo Librandi, Sep 24 2013
  • Mathematica
    CoefficientList[Series[(279 + 2322 x - 5736 x^2 + 704 x^3)/((1 - 2 x) (1 - 4 x)), {x, 0, 40}], x] (* Vincenzo Librandi, Sep 24 2013 *)
  • PARI
    {m=19; v=concat([279, 3996, 16008, 64784], vector(m-4)); for(n=5, m, v[n]=6*v[n-1]-8*v[n-2]); v}
    

Formula

a(n) = 4^(n+5)-47*2^(n+1) for n > 1.
G.f.: (279+2322*x-5736*x^2+704*x^3) / ((1-2*x)*(1-4*x)).
G.f. for the sequence starting at a(2): 8*x^2*(2001-3908*x)/((1-2*x)*(1-4*x)).

A177845 a(n) = 6*a(n-1)-8*a(n-2)-3 for n > 2; a(0)=775, a(1)=8919, a(2)=34223.

Original entry on oeis.org

775, 8919, 34223, 133983, 530111, 2108799, 8411903, 33601023, 134310911, 537057279, 2147856383, 8590680063, 34361229311, 137441935359, 549761777663, 2199035183103, 8796116877311, 35184419799039, 140737583775743
Offset: 0

Views

Author

Klaus Brockhaus, May 14 2010

Keywords

Comments

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

Crossrefs

Cf. A077077 (Reverse and Add trajectory of 775 in base 2), A177843, A177844, A177846.

Programs

  • Magma
    [775] cat [2*4^(n+5)+91*2^(n+2)-1: n in [1..25]]; // Vincenzo Librandi, Sep 24 2013
  • Mathematica
    nxt[{a_,b_}]:={b,6b-8a-3}; Join[{775},Transpose[NestList[nxt,{8919,34223},20]][[1]]] (* or *) Join[{775},LinearRecurrence[{7,-14,8},{8919,34223,133983},20]] (* Harvey P. Dale, Mar 04 2013 *)
    CoefficientList[Series[(775 + 3494 x - 17360 x^2 + 13088 x^3)/((1 - x) (1 - 2 x) (1 - 4 x)), {x, 0, 40}], x] (* Vincenzo Librandi, Sep 24 2013 *)
  • PARI
    {m=19; v=concat([775, 8919, 34223], vector(m-3)); for(n=4, m, v[n]=6*v[n-1]-8*v[n-2]-3); v}
    

Formula

a(n) = 2*4^(n+5)+91*2^(n+2)-1 for n > 0.
G.f.: (775+3494*x-17360*x^2+13088*x^3) / ((1-x)*(1-2*x)*(1-4*x)).
G.f. for the sequence starting at a(1): x*(8919-28210*x+19288*x^2) / ((1-x)*(1-2*x)*(1-4*x)).
a(0)=775, a(1)=8919, a(2)=34223, a(3)=133983, a(n)=7*a(n-1)-14*a(n-2)+8*a(n-3). - Harvey P. Dale, Mar 04 2013

A177846 a(n) = 6*a(n-1)-8*a(n-2) for n > 2; a(0)=837, a(1)=7896, a(2)=32176.

Original entry on oeis.org

837, 7896, 32176, 129888, 521920, 2092416, 8379136, 33535488, 134179840, 536795136, 2147332096, 8589631488, 34359132160, 137437741056, 549753389056, 2199018405888, 8796083322880, 35184352690176, 140737449558016
Offset: 0

Views

Author

Klaus Brockhaus, May 14 2010

Keywords

Comments

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

Crossrefs

Cf. A077077 (Reverse and Add trajectory of 775 in base 2), A177843, A177844, A177845.

Programs

  • Magma
    [837] cat [2*4^(n+5)-37*2^(n+2): n in [1..25]]; // Vincenzo Librandi, Sep 24 2013
  • Mathematica
    CoefficientList[Series[(837 + 2874 x - 8504 x^2)/((1 - 2 x) (1 - 4 x)), {x, 0, 40}], x] (* Vincenzo Librandi, Sep 24 2013 *)
  • PARI
    {m=19; v=concat([837, 7896, 32176], vector(m-3)); for(n=4, m, v[n]=6*v[n-1]-8*v[n-2]); v}
    

Formula

a(n) = 2*4^(n+5)-37*2^(n+2) for n > 0.
G.f.: (837+2874*x-8504*x^2) / ((1-2*x)*(1-4*x)).
G.f. for the sequence starting at a(1): 8*x*(987-1900*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.