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

A062131 A062129 written in base 10.

Original entry on oeis.org

0, 3, 3, 9, 5, 15, 9, 21, 9, 27, 15, 27, 15, 27, 21, 45, 17, 51, 27, 99, 99, 63, -1, 63, 27, 99, -1, 255, -1, 63, 45, 93, 33, 99, 51, -1, 45, -1, 63, 99, 45, -1, 63, 99, 99, -1, -1, -1, 51, -1, 255, 153, 63, 99, 255, 153, 63, 99, 255, 153, -1, -1, 93, 189, 65, 195, 99, -1, 85, 255, 119, 387, 255, 219, 13299, -1, 387, -1, -1, 219
Offset: 0

Views

Author

Klaus Brockhaus, Jun 06 2001

Keywords

Comments

Differs from A062130 only for those n, which are palindromes in base 2.

Examples

			23 -> 23 + 29 = 52 -> 52 + 11 = 63, so a(23) = 63.
		

Crossrefs

Programs

  • ARIBAS
    stop := 500; for k := 0 to 80 do c := 0; m := k; test := true; while test and c < stop do inc(c); m := m + bit_reverse(m); test := m <> bit_reverse(m); end; if c < stop then write(m); else write(-1); end; write(" "); end;

A062128 In base 2: start with n; if palindrome, stop; otherwise add to itself with digits reversed; a(n) gives palindrome at which it stops, or -1 if no palindrome is ever reached.

Original entry on oeis.org

0, 1, 11, 11, 101, 101, 1001, 111, 1001, 1001, 1111, 11011, 1111, 11011, 10101, 1111, 10001, 10001, 11011, 1100011, 1100011, 10101, -1, 111111, 11011, 1100011, -1, 11011, -1, 111111, 101101, 11111, 100001, 100001, 110011, -1, 101101, -1, 111111, 1100011, 101101, -1, 111111, 1100011, 1100011
Offset: 0

Views

Author

Klaus Brockhaus, Jun 06 2001

Keywords

Comments

The analog of A033865 in base 2.

Examples

			23: 10111 -> 10111 + 11101 = 110100 -> 110100 + 1011 = 111111, so a(23) = 111111.
		

Crossrefs

Programs

  • ARIBAS
    stop := 500; for k := 0 to 60 do c := 0; m := k; rev := bit_reverse(m); while m <> rev and c < stop do inc(c); m := m + rev; rev := bit_reverse(m); end; if c < stop then bit_write(m); else write(-1); end; write(" "); end;
  • Mathematica
    limit = 10^4; (* Assumes that there is no palindrome if none is found before "limit" iterations *)
    BaseForm[Table[np = n; i = 0;
      While[np != IntegerReverse[np, 2] && i < limit,
       np = np + IntegerReverse[np, 2]; i++];
    If[i >= limit, -1, np], {n, 0, 44}], 2] (* Robert Price, Oct 14 2019 *)

A060382 In base n, a(n) is the smallest number m that leads to a palindrome-free sequence, using the following process: start with m; reverse the digits and add it to m, repeat. Stop if you reach a palindrome.

Original entry on oeis.org

22, 103, 290, 708, 1079, 2656, 1021, 593, 196, 1011, 237, 2701, 361, 447, 413, 3297, 519, 341, 379, 711, 461, 505, 551, 1022, 649, 701, 755, 811, 869, 929, 991, 1055, 1799, 1922, 1259, 1331, 1405, 1481, 1559, 1639, 1595, 1762, 1891, 1934, 2069, 2161
Offset: 2

Views

Author

Michel ten Voorde, Apr 03 2001

Keywords

Comments

Only a(2) is proved, all the others are conjectured. - Eric Chen, Apr 20 2015 [corrected by A.H.M. Smeets, May 27 2019]
Brown's link reports a(3) as 103 instead of 100. What is the correct value? Dmitry Kamenetsky, Mar 06 2017 [a(3) = 103 is correct as from A077404, A.H.M. Smeets, May 27 2019]
From A.H.M. Smeets, May 27 2019: (Start)
It seems that a(n) < n^2 (i.e., a(n) in base n has two digits) and the least significant digit of a(n) in base n equals n-1, for n > 73.
For n <= 73 and the least significant digit of a(n) in base n is unequal to n-1, then the most significant digit of a(n) in base n equals 1.
From this it seems that, the least significant digit of a(n) in base n equals n-1 or the most significant digit of a(n) in base n equals 1, holds for all n > 1.
For n > 305 it seems that a(n) < n^2 - n - 1.
It seems that a(n) >= n*floor(3*n/4)-1; i.e. for any a(n) which is represented by a two-digit number in base n, the most significant digit is at least floor(3*n/4)-1. (End)
From A.H.M. Smeets, May 30 2019: (Start)
a(n) is a 5-digit number in base n representation for n in {2,3,4,5,7}.
a(n) is a 4-digit number in base n representation for n in {6,8,13}.
a(n) is a 3-digit number in base n representation for n in {9,10,11,12,14,15,16,17,18,21,25,34,35,52,71,72,73}.
For all other bases n, a(n) is a 2-digit number in base-n representation.
If a(n) = n*floor(3*n/4)-1, then n == 0 (mod 4) or n == 3 (mod 4). (End)

Examples

			a(2) = 22 since A062129(k) > -1 (equivalently, A062131(k) > -1) for k < 22.
		

Crossrefs

For the first palindrome in non-palindrome-free sequences, cf. A062129/A062131 (base 2), A033865 (base 10), A253241 (base 12).

Programs

  • Python
    def rev(n,base):
        m = 0
        while n > 0:
            n, m = n//base, m*base+n%base
        return m
    n, a, steps = 2, 3, 0
    while n <= 20000:
        aa = a
        ra = rev(a,n)
        while aa != ra and steps < 1000:
            aa = aa+ra
            ra, steps = rev(aa,n), steps+1
        if aa == ra:
            a, aa, steps = a+1, a+1, 0
        if steps == 1000:
            print(n,a)
            n, a, steps = n+1, n+2, 0 # A.H.M. Smeets, May 27 2019

Extensions

More terms from Karl Hovekamp, Jan 03 2007

A253241 The "Reverse and Add!" problem in base 12: sequence lists the final palindrome number for n, or -1 if no palindrome is ever reached. (Written in base 10.)

Original entry on oeis.org

0, 2, 4, 6, 8, 10, 13, 39, 65, 91, 117, 143, 13, 26, 39, 52, 65, 78, 91, 104, 117, 130, 143, 169, 26, 39, 52, 65, 78, 91, 104, 117, 130, 143, 169, 169, 39, 52, 65, 78, 91, 104, 117, 130, 143, 169, 169, 507, 52, 65, 78, 91, 104, 117, 130, 143, 169, 169, 507, 676, 65, 78, 91, 104, 117
Offset: 0

Views

Author

Eric Chen, Apr 07 2015

Keywords

Comments

Is a(n) = -1 possible? All numbers below 100 (decimal 144) reach a palindrome.
a(237) is conjectured to be -1.
A060382 lists the smallest possible Lychrel number in base n.

Examples

			a(29) = 91 since (in duodecimal) 25 (decimal 29) + 52 = 77 (decimal 91) and 77 is a palindrome.
a(69) = 507 since (in duodecimal) 59 (decimal 69) + 95 = 132, 132 + 231 = 363 (decimal 507) and 363 is a palindrome.
a(105) = 1885 since (in duodecimal) 89 (decimal 105) + 98 = 165, 165 + 561 = 706, 706 + 607 = 1111 (decimal 1885) and 1111 is a palindrome.
		

Crossrefs

Programs

  • Mathematica
    tol = 1728; r[n_] := FromDigits[Reverse[IntegerDigits[n, 12]], 12]; palQ[n_] := n == r[n]; ar[n_] := n + r[n]; Table[k = 0; If[palQ[n], n = ar[n]; k = 1]; While[! palQ[n] && k < tol, n = ar[n]; k++]; If[k == tol, n = -1]; n, {n, 0, 144}]
Showing 1-4 of 4 results.