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 10 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

A055944 a(n) = n + (reversal of base-2 digits of n) (written in base 10).

Original entry on oeis.org

0, 2, 3, 6, 5, 10, 9, 14, 9, 18, 15, 24, 15, 24, 21, 30, 17, 34, 27, 44, 25, 42, 35, 52, 27, 44, 37, 54, 35, 52, 45, 62, 33, 66, 51, 84, 45, 78, 63, 96, 45, 78, 63, 96, 57, 90, 75, 108, 51, 84, 69, 102, 63, 96, 81, 114, 63, 96, 81, 114, 75, 108, 93, 126, 65, 130, 99, 164, 85
Offset: 0

Views

Author

Henry Bottomley, Jul 18 2000

Keywords

Comments

If n has an even number of digits in base-2 then a(n) is a multiple of 3.

Crossrefs

Cf. A030101, A035522 (iterated), A055948.

Programs

  • Haskell
    a055944 n = n + a030101 n  -- Reinhard Zumkeller, Nov 14 2011
  • Mathematica
    f[n_] := Block[{id = IntegerDigits[n, 2]}, FromDigits[id + Reverse@id, 2]]; Array[f, 69, 0] (* Robert G. Wilson v, Nov 07 2010 *)
    Array[#+FromDigits[Reverse[IntegerDigits[#,2]],2]&,70,0] (* Harvey P. Dale, Feb 09 2025 *)

Formula

a(n) = n + A030101(n).

A035524 Reverse and add (in base 4).

Original entry on oeis.org

1, 2, 4, 5, 10, 20, 25, 50, 85, 170, 340, 425, 850, 1385, 3070, 6140, 10225, 15335, 29410, 65135, 129070, 317675, 1280860, 2163725, 3999775, 7999550, 20321515, 81946460, 138412045, 255852575, 511705150, 1300234475, 5242880860
Offset: 0

Views

Author

Keywords

Crossrefs

Cf. A035522.
Cf. A030103.

Programs

  • Haskell
    a035524 n = a035524_list !! n
    a035524_list = iterate a055948 1
    -- Reinhard Zumkeller, Oct 10 2011
    
  • Mathematica
    nxt4[n_]:=Module[{idn4=IntegerDigits[n,4]},FromDigits[idn4+ Reverse[idn4], 4]]; NestList[nxt4,1,40] (* Harvey P. Dale, May 02 2011 *)
  • Python
    def reversedigits(n, b=10): # reverse digits of n in base b
        x, y = n, 0
        while x >= b:
            x, r = divmod(x, b)
            y = b*y + r
        return b*y + x
    A035524_list, l = [1], 1
    for _ in range(50):
        l += reversedigits(l,4)
        A035524_list.append(l)

Formula

a(n+1) = A055948(a(n)), a(0) = 1. [Reinhard Zumkeller, Oct 10 2011]

Extensions

More terms from Larry Reeves (larryr(AT)acm.org), Sep 22 2000

A092213 In base 2: numbers n of the form k + reverse(k) for at least one k.

Original entry on oeis.org

0, 2, 3, 5, 6, 9, 10, 14, 15, 17, 18, 21, 24, 25, 27, 30, 33, 34, 35, 37, 42, 44, 45, 51, 52, 54, 57, 62, 63, 65, 66, 69, 75, 78, 81, 84, 85, 90, 93, 96, 99, 101, 102, 105, 108, 114, 115, 119, 121, 126, 129, 130, 133, 135, 139, 146, 149, 150, 153, 155, 164, 165, 166
Offset: 0

Views

Author

Klaus Brockhaus, Feb 25 2004

Keywords

Comments

Base-2 analog of A067030 (base 10) and A091678 (base 4). Complement of A092214.

Examples

			25 is a term since 25 (decimal) = 11001 = 10100 + 00101 = 20 (decimal) + 5 (decimal).
		

Crossrefs

A092210 Positive integers n such that the trajectory of n under the Reverse and Add! operation carried out in base 2 (presumably) does not join the trajectory of any m < n.

Original entry on oeis.org

1, 16, 64, 74, 98, 107, 259, 266, 271, 275, 298, 398, 442, 454, 522, 794, 911, 1027, 1046, 1057, 1066, 1070, 1073, 1076, 1081, 1082, 1085, 1115, 1274, 1422, 1562, 1570, 1967, 2070, 2329, 3106, 3355, 3871, 4099, 4114, 4120, 4126, 4136, 4152, 4182, 4189
Offset: 1

Views

Author

Klaus Brockhaus, Feb 25 2004

Keywords

Comments

The conjecture that the base 2 trajectories of the terms do not join is based on the observation that if the trajectories of two integers < 12000 join, this happens after at most 93 steps, while for any two terms listed above the trajectories do not join within 1000 steps. For pairs from 1, 16, 64, 74, 98, 107 this has even been checked for 5000 steps.
Base-2 analog of A070788 (base 10) and A091675 (base 4).

Examples

			The trajectory of 2 is part of the trajectory of 1 (cf. A035522); the trajectory of 16 does not join the trajectory of 1 within 10000 steps; the trajectory of 64 does not join the trajectory of 1 or of 16 within 10000 steps.
		

Crossrefs

Programs

  • Mathematica
    limit = 10^3; (* Assumes that there is no palindrome if none is found before "limit" iterations *)
    utraj = NestList[# + IntegerReverse[#, 2] &, 1, limit];
    Flatten@{1, Select[Range[2, 4189],   (l = Length@NestWhileList[# + IntegerReverse[#, 2] &, #, ! MemberQ[utraj, #] &, 1, limit];
      utraj = Union[utraj, NestList[# + IntegerReverse[#, 2] &, #, limit]];
      l == limit + 1) &]} (* Robert Price, Nov 03 2019 *)

A035526 Reverse and add (in binary).

Original entry on oeis.org

1, 10, 11, 110, 1001, 10010, 11011, 110110, 1010001, 10010110, 11111111, 111111110, 1011111101, 10111111010, 100011110111, 1011111101000, 1101011100101, 10111111010000, 11001011001101, 101111110100000
Offset: 0

Views

Author

N. J. A. Sloane, E. M. Rains

Keywords

Comments

First 4 members are the divisors of 6 (the first perfect number), written in base 2 (see A135652, A135653, A135654, A135655). - Omar E. Pol, May 04 2008

Examples

			110 + 011 = 1001.
		

Crossrefs

Cf. A035522 for same sequence but written in base 10.
Cf. A007088.

Programs

  • Haskell
    a035526 = a007088 . a035522  -- Reinhard Zumkeller, Jan 02 2015
    
  • Python
    from itertools import accumulate, repeat
    def iterate(n, _): b = str(n); return int(bin(int(b, 2)+int(b[::-1], 2))[2:])
    def aupto(nn): return list(accumulate(repeat(1, nn), iterate))
    print(aupto(20)) # Michael S. Branicky, Jan 10 2021

Formula

a(n) = A007088(A035522(n)). - Reinhard Zumkeller, Jan 02 2015

A059990 Number of points of period n under the dual of the map x->2x on Z[1/6].

Original entry on oeis.org

1, 1, 7, 5, 31, 7, 127, 85, 511, 341, 2047, 455, 8191, 5461, 32767, 21845, 131071, 9709, 524287, 349525, 2097151, 1398101, 8388607, 1864135, 33554431, 22369621, 134217727, 89478485, 536870911, 119304647
Offset: 1

Views

Author

Thomas Ward, Mar 08 2001

Keywords

Comments

This sequence counts the periodic points in the simplest nontrivial S-integer dynamical system. These dynamical systems arise naturally in arithmetic and are built by making an isometric extension of a familiar hyperbolic system. The extension destroys some of the periodic points, in this case reducing the original number 2^n-1 by factoring out any 3's. An interesting feature is that the logarithmic growth rate is still log 2.
A059990[n+7] times some power of 3 seems to me the greatest common Denominator of A035522[4n+16+1],A035522[4n+16+2],A035522[4n+16+3] and A035522[4n+16+4] for n>1 [From Dylan Hamilton, Aug 04 2010]

Examples

			a(6)=7 because 2^6-1 = 3^2x7, so |2^6-1|_3=3^(-2).
		

References

  • V. Chothi, G. Everest, T. Ward. S-integer dynamical systems: periodic points. J. Reine Angew. Math., 489 (1997), 99-132.
  • T. Ward. Almost all S-integer dynamical systems have many periodic points. Erg. Th. Dynam. Sys. 18 (1998), 471-486.

Crossrefs

Formula

a(n)=(2^n-1)x|2^n-1|_3

A035523 Reverse and add (in base 3).

Original entry on oeis.org

1, 2, 4, 8, 16, 32, 96, 160, 320, 960, 1600, 2880, 3520, 6080, 11200, 21440, 62400, 86080, 169280, 338560, 648248, 1902840, 3281200, 6404832, 6510784, 12950936, 25744192, 51882584, 156278688, 261609208, 506142216, 531792640, 1008314456, 2014504120
Offset: 0

Views

Author

Keywords

Examples

			32 = 1012, 1012 + 2101 = 10120 = 96.
		

Crossrefs

Cf. A035522.

Programs

  • Maple
    A035523 := proc(n)
        option remember;
        if n =1 then
            1;
        else
            A055946(procname(n-1)) ;
        end if;
    end proc: # R. J. Mathar, May 28 2016
  • Mathematica
    NestList[ (Fold[ 3 #1+#2&, 0, Reverse@IntegerDigits[ #, 3 ] ]+#&), 1, 40 ]
    Join[{m = 1}, Table[m = m + FromDigits[Reverse[IntegerDigits[m, 3]], 3], {35}]] (* T. D. Noe, May 02 2012 *)
    NestList[#+IntegerReverse[#,3]&,1,40] (* The program uses the IntegerRevese function from Mathematica version 10 *) (* Harvey P. Dale, Feb 21 2016 *)
  • Python
    def reversedigits(n, b=10): # reverse digits of n in base b
        x, y = n, 0
        while x >= b:
            x, r = divmod(x, b)
            y = b*y + r
        return b*y + x
    A035523_list, l = [1], 1
    for _ in range(50):
        l += reversedigits(l, 3)
        A035523_list.append(l)
     # Chai Wah Wu, Jan 03 2015

Formula

a(n) = A055946(a(n-1)). - R. J. Mathar, May 28 2016

Extensions

More terms from Wouter Meeussen

A092215 Smallest number whose base-2 Reverse and Add! trajectory (presumably) contains exactly n base-2 palindromes, or -1 if there is no such number.

Original entry on oeis.org

22, 30, 10, 4, 6, 2, 1, 132, 314, 403, 259, 2048, -1, -1, -1, -1
Offset: 0

Views

Author

Klaus Brockhaus, Feb 25 2004

Keywords

Comments

Conjecture 1: For each k > 0 the trajectory of k eventually leads to a term in the trajectory of some j which belongs to A075252, i.e., whose trajectory (presumably) never leads to a palindrome. Conjecture 2: There is no k > 0 such that the trajectory of k contains more than eleven base 2 palindromes, i.e., a(n) = -1 for n > 11.
Base-2 analog of A077594 (base 10) and A091680 (base 4).

Examples

			a(4) = 6 since the trajectory of 6 contains the four palindromes 9, 27, 255, 765 (1001, 11011, 11111111, 1011111101 in base 2) and at 48960 joins the trajectory of 22 = A075252(1) and the trajectories of 1 (A035522), 2, 3, 4, 5 contain resp. 6, 5, 5, 3, 3 palindromes.
		

Crossrefs

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