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 19 results. Next

A066059 Integers such that the 'Reverse and Add!' algorithm in base 2 (cf. A062128) does not lead to a palindrome.

Original entry on oeis.org

22, 26, 28, 35, 37, 41, 46, 47, 49, 60, 61, 67, 75, 77, 78, 84, 86, 89, 90, 94, 95, 97, 105, 106, 108, 110, 116, 120, 122, 124, 125, 131, 135, 139, 141, 147, 149, 152, 155, 157, 158, 163, 164, 166, 169, 172, 174, 177, 180, 182, 185, 186, 190, 191, 193, 197, 199
Offset: 1

Views

Author

Klaus Brockhaus, Dec 04 2001

Keywords

Comments

The analog of A023108 in base 2.
It seems that for all these numbers it can be proven that they never reach a palindrome. For this it is sufficient to prove this for all seeds as given in A075252. As observed, for all numbers in A075252, lim_{n -> inf} t(n+1)/t(n) is 1 or 2 (1 for even n, 2 for odd n or reverse); i.e., lim_{n -> inf} t(n+2)/t(n) = 2, t(n) being the n-th term of the trajectory. - A.H.M. Smeets, Feb 10 2019

Crossrefs

Programs

  • ARIBAS
    : For function b2reverse see A066057; function a066059(mx,stop: integer); var k,c,m,rev: integer; begin for k := 1 to mx do c := 0; m := k; rev := b2reverse(m); while m <> rev and c < stop do inc(c); m := m + rev; rev := b2reverse(m); end; if c >= stop then write(k," "); end; end; end; a066059(210,300).
  • Mathematica
    limit = 10^4; (* Assumes that there is no palindrome if none is found before "limit" iterations *)
    Select[Range[200],
    Length@NestWhileList[# + IntegerReverse[#, 2] &, #, # !=
    IntegerReverse[#, 2]  &, 1, limit] == limit + 1 &] (* Robert Price, Oct 14 2019 *)

A066122 Numbers that in base 2 need one 'Reverse and Add' step to reach a palindrome.

Original entry on oeis.org

2, 4, 6, 8, 10, 12, 14, 16, 18, 24, 30, 32, 34, 36, 38, 40, 42, 48, 52, 56, 62, 64, 66, 68, 70, 80, 82, 96, 100, 102, 112, 114, 126, 128, 130, 132, 134, 136, 138, 140, 142, 144, 146, 148, 150, 160, 162, 168, 170, 176, 178, 192, 196, 198, 200, 204, 208, 212, 224
Offset: 1

Views

Author

Klaus Brockhaus, Dec 08 2001

Keywords

Comments

The analog of A065206 in base 2. The number of steps starts at 0, so palindromes (cf. A006995) are excluded.
Numbers k such that A066057(k) = 1. - Andrew Howroyd, Dec 05 2024

Crossrefs

Sequences for 2..12 steps needed are: A066123, A066124, A066125, A066126, A066127, A066128, A066129, A066130, A066131, A066132, A066133.

Programs

  • ARIBAS
    : function b2revadd_steps(k,stop: integer); var c,n,m,steps,rev: integer; begin n := 0; c := 0; while c < stop do m := n; rev := b2reverse(m); steps := 0; while steps < k and m <> rev do m := m + rev; rev := b2reverse(m); inc(steps); end; if steps = k and m = rev then write(n," "); inc(c); end; inc(n); end; end; b2revadd_steps(1,66).
    
  • PARI
    isok(n,s=1)={for(k=0, s, my(r=fromdigits(Vecrev(binary(n)),2)); if(r==n, return(k==s)); n += r); 0} \\ Andrew Howroyd, Dec 05 2024

Extensions

Offset changed from 0 to 1 by Harry J. Smith, Feb 01 2010

A066058 In base 2: smallest integer which requires n 'Reverse and Add' steps to reach a palindrome.

Original entry on oeis.org

0, 2, 11, 44, 19, 20, 275, 326, 259, 202, 103, 74, 1027, 1070, 1049, 1072, 1547, 1310, 1117, 794, 569, 398, 3083, 2154, 1177, 1064, 4697, 4264, 4443, 2678, 2169, 1422, 779, 3226, 1551, 1114, 1815, 1062, 4197, 3106, 8697, 7238, 16633, 12302, 6683
Offset: 0

Views

Author

Klaus Brockhaus, Dec 04 2001

Keywords

Comments

The analog of A023109 in base 2.

Examples

			11 is the smallest integer which requires two steps to reach a base 2 palindrome (cf. A066057), so a(2) = 11; written in base 10: 11 -> 11 + 13 = 24 -> 24 + 3 = 27; written in base 2: 1011 -> 1011 + 1101 = 11000 -> 11000 + 11 = 11011.
		

Crossrefs

Programs

  • ARIBAS
    (* For function b2reverse see A066057. *) function a066058(mx: integer); var k,m,n,rev,steps: integer; begin for k := 0 to mx do n := 0; steps := 0; m := n; rev := b2reverse(m); while not(steps = k and m = rev) do inc(n); m := n; rev := b2reverse(m); steps := 0; while steps < k and m <> rev do m := m + rev; rev := b2reverse(m); inc(steps); end; end; write(n,","); end; end; a066058(45);
    
  • Mathematica
    Table[ SelectFirst[Range[0, 20000], (np = #; i = 0;
        While[ np != IntegerReverse[np, 2] && i <= n,
         np = np + IntegerReverse[np, 2]; i++];
    i == n ) &] , {n, 0, 44}] (* Robert Price, Oct 16 2019 *)
  • Python
    def A066058(n):
        if n > 0:
            k = 0
            while True:
                m = k
                for i in range(n):
                    s1 = format(m,'b')
                    s2 = s1[::-1]
                    if s1 == s2:
                        break
                    m += int(s2,2)
                else:
                    s1 = format(m,'b')
                    if s1 == s1[::-1]:
                        return k
                k += 1
        else:
            return 0 # Chai Wah Wu, Jan 06 2015

A066144 In base 2: n sets a new record for the number of 'Reverse and Add' steps needed to reach a palindrome starting with n.

Original entry on oeis.org

0, 2, 11, 19, 20, 74, 398, 779, 1062, 2329, 4189, 4280, 11278, 19962, 98318, 135137, 1051360, 1592930, 69226926, 4295054186, 4446008678, 17187271449, 18123849698
Offset: 1

Views

Author

Klaus Brockhaus, Dec 08 2001

Keywords

Comments

The analog of A065198 in base 2. Integers like 22, for which a palindrome is never reached (cf. A066059), are of course disregarded. A066145 gives the corresponding records.

Examples

			Starting with 74, 11 'Reverse and Add' steps are needed to reach a palindrome; starting with n < 74, less (at most 5) steps are needed.
		

Crossrefs

Record setting values in base b: A077406 (b=3), A075686 (b=4), A306599 (b=8), A065198 (b=10), A348571 (Zeckendorf).

Programs

  • Mathematica
    limit = 10^4; (* Assumes that there is no palindrome if none is found before "limit" iterations *)
    best = -1; Select[Range[0, 100000], (np = #; i = 0;
       While[np != IntegerReverse[np, 2] && i < limit,
        np = np + IntegerReverse[np, 2]; i++];
    If[i >= limit, False, If[i > best, best = i; True]]) &] (* Robert Price, Oct 14 2019 *)

Extensions

Offset corrected and a(19)-a(23) from A.H.M. Smeets, Apr 30 2022

A066145 In base 2, records for the number of 'Reverse and Add' steps needed to reach a palindrome.

Original entry on oeis.org

0, 1, 2, 4, 5, 11, 21, 32, 37, 46, 48, 49, 53, 89, 99, 142, 147, 273, 297, 345, 515, 550, 573
Offset: 1

Views

Author

Klaus Brockhaus, Dec 08 2001

Keywords

Comments

The analog of A065199 in base 2. A066144 gives the corresponding starting points.
Terms a(19..22) obtained by assuming that a(n+1) <= a(n) + 300. - A.H.M. Smeets, Apr 30 2022

Examples

			Starting with 74, 11 'Reverse and Add' steps are needed to reach a palindrome; starting with n < 74, at most 5 steps are needed.
		

Crossrefs

Record values in base b: A077407 (b=3), A075687 (b=4), A306600 (b=8), A065199 (b=10), A348572 (Zeckendorf).

Programs

  • Mathematica
    limit = 10^3; (* Assumes that there is no palindrome if none is found before "limit" iterations *)
    best = -1; lst = {};
    For[n = 0, n <= 10000, n++,
    np = n; i = 0;
    While[np != IntegerReverse[np, 2] && i < limit,
      np = np + IntegerReverse[np, 2]; i++];
    If[i < limit && i > best, best = i; AppendTo[lst, i]]]; lst (* Robert Price, Oct 14 2019 *)

Extensions

Offset corrected and a(19)-a(23) by A.H.M. Smeets, Apr 30 2022

A075685 Reverse and Add! carried out in base 4; number of steps needed to reach a palindrome, or -1 if no palindrome is ever reached.

Original entry on oeis.org

0, 0, 0, 0, 1, 0, 1, 2, 1, 1, 0, 1, 1, 2, 1, 0, 1, 0, 1, 2, 1, 0, 1, 2, 2, 0, 3, 2, 4, 0, 4, 3, 1, 1, 0, 1, 1, 1, 0, 4, 2, 3, 0, 2, 3, 4, 0, 4, 1, 2, 1, 0, 1, 2, 4, 0, 3, 2, 2, 0, 4, 3, 4, 0, 1, 0, 1, 2, 1, 1, 1, 2, 1, 1, 1, 3, 1, 1, 1, 2, 1, 1, 1, 2, 1, 0, 1, 3, 1, 1, 1, 2, 2, 3, 3, 2, 1, 1, 1, 3, 1, 1, 1, 2, 2
Offset: 0

Views

Author

Klaus Brockhaus, Sep 24 2002

Keywords

Comments

Base-4 analog of A033665 (base 10) and A066057 (base 2). For values of n such that presumably a(n) = -1 see A075420.

Examples

			26 (decimal) = 122 -> 122 + 221 = 1003 -> 1003 + 3001 = 10010 -> 10010 + 01001 = 11011 (palindrome) = 325 (decimal) requires 3 steps, so a(26) = 3.
		

Crossrefs

Programs

  • ARIBAS
    m := 105; stop := 1000; for n := 0 to m do c := 0; k := n; v := -1; while c < stop do a := k; rev := 0; while a > 0 do rev := 4*rev + (a mod 4); a := a div 4; end; if k = rev then v := c; c := stop; else inc(c); k := k + rev; end; end; write(v," "); end;.

A066123 Numbers that in base 2 need two 'Reverse and Add' steps to reach a palindrome.

Original entry on oeis.org

11, 13, 23, 29, 39, 43, 53, 55, 57, 59, 69, 79, 81, 87, 91, 109, 117, 121, 133, 143, 151, 161, 167, 171, 173, 175, 179, 181, 183, 205, 207, 213, 215, 229, 233, 235, 237, 239, 241, 243, 245, 247, 261, 265, 277, 287, 289, 303, 311, 321, 327, 337, 343, 347, 349
Offset: 1

Views

Author

Klaus Brockhaus, Dec 08 2001

Keywords

Comments

The analog of A065207 in base 2. The number of steps starts at 0, so palindromes (cf. A006995) are excluded.
Numbers k such that A066057(k) = 2. - Andrew Howroyd, Dec 05 2024

Crossrefs

Programs

  • PARI
    isok(n,s=2)={for(k=0, s, my(r=fromdigits(Vecrev(binary(n)),2)); if(r==n, return(k==s)); n += r); 0} \\ Andrew Howroyd, Dec 05 2024

Extensions

Offset changed from 0 to 1 by Harry J. Smith, Feb 01 2010

A066124 Numbers that in base 2 need three 'Reverse and Add' steps to reach a palindrome.

Original entry on oeis.org

44, 50, 54, 58, 72, 92, 98, 118, 154, 156, 184, 194, 206, 214, 216, 234, 242, 272, 296, 316, 364, 376, 386, 406, 466, 470, 478, 502, 564, 566, 570, 572, 626, 628, 634, 688, 690, 696, 716, 732, 748, 752, 770, 790, 798, 806, 814, 820, 822, 824, 854, 870, 880
Offset: 1

Views

Author

Klaus Brockhaus, Dec 08 2001

Keywords

Comments

The analog of A065208 in base 2. The number of steps starts at 0, so palindromes (cf. A006995) are excluded.
Numbers k such that A066057(k) = 3. - Andrew Howroyd, Dec 05 2024

Crossrefs

Programs

  • PARI
    isok(n,s=3)={for(k=0, s, my(r=fromdigits(Vecrev(binary(n)),2)); if(r==n, return(k==s)); n += r); 0} \\ Andrew Howroyd, Dec 05 2024

Extensions

Offset changed from 0 to 1 by Harry J. Smith, Feb 01 2010

A066125 Numbers that in base 2 need four 'Reverse and Add' steps to reach a palindrome.

Original entry on oeis.org

19, 25, 71, 83, 101, 111, 113, 123, 271, 283, 295, 307, 319, 331, 333, 335, 355, 357, 359, 379, 395, 397, 409, 415, 419, 421, 431, 433, 439, 445, 457, 461, 463, 475, 481, 485, 487, 491, 499, 505, 571, 627, 825, 881, 911, 967, 1055, 1079, 1083, 1103, 1127
Offset: 1

Views

Author

Klaus Brockhaus, Dec 08 2001

Keywords

Comments

The analog of A065209 in base 2. The number of steps starts at 0, so palindromes (cf. A006995) are excluded.
Numbers k such that A066057(k) = 4. - Andrew Howroyd, Dec 05 2024

Crossrefs

Programs

Extensions

Offset changed from 0 to 1 by Harry J. Smith, Feb 01 2010

A066126 Numbers that in base 2 need five 'Reverse and Add' steps to reach a palindrome.

Original entry on oeis.org

20, 76, 88, 230, 238, 246, 274, 276, 278, 284, 308, 314, 332, 336, 338, 344, 356, 368, 380, 400, 404, 440, 464, 660, 662, 676, 678, 694, 702, 758, 916, 932, 948, 956, 1012, 1076, 1078, 1084, 1106, 1124, 1126, 1132, 1142, 1180, 1204, 1228, 1252, 1308
Offset: 1

Views

Author

Klaus Brockhaus, Dec 08 2001

Keywords

Comments

The analog of A065210 in base 2. The number of steps starts at 0, so palindromes (cf. A006995) are excluded.
Numbers k such that A066057(k) = 5. - Andrew Howroyd, Dec 05 2024

Crossrefs

Extensions

Offset changed from 0 to 1 by Harry J. Smith, Feb 01 2010
Showing 1-10 of 19 results. Next