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.

Previous Showing 11-20 of 42 results. Next

A067032 Number of k's such that A067030(n) = k + reverse(k).

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 9, 9, 7, 1, 6, 5, 1, 4, 3, 1, 2, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 5, 6, 5, 6, 5, 6, 5, 6, 5, 6, 6, 7, 6, 7, 6, 7, 6, 7, 6, 7, 7, 8, 7, 8, 7, 8, 7, 8, 7, 8, 8, 9, 8
Offset: 0

Views

Author

Klaus Brockhaus, Dec 29 2001

Keywords

Examples

			a(12) = 3 since A067030(12) = 33 and for k = 12, 21, 30 we have 33 = k + reverse(k).
		

Crossrefs

Programs

  • ARIBAS
    function a067032(a,b: integer); var n,k,c,i,rev: integer; st,nst: string; begin for n := a to b do k := 0; c := 0; while k <= n do st := itoa(k); nst := ""; for i := 0 to length(st) - 1 do nst := concat(st[i],nst); end; rev := atoi(nst); if n = k + rev then inc(c); end; inc(k); end; if c > 0 then write(c,","); end; end; end; a067032(0,1000);

A063049 Integers n > 196 such that the 'Reverse and Add!' trajectory of n joins the trajectory of 196.

Original entry on oeis.org

295, 394, 493, 592, 689, 691, 788, 790, 887, 986, 1495, 1585, 1675, 1765, 1855, 1945, 2494, 2584, 2674, 2764, 2854, 2944, 3493, 3583, 3673, 3763, 3853, 3943, 4079, 4169, 4259, 4349, 4439, 4492, 4529, 4582, 4619, 4672, 4709, 4762, 4799, 4852, 4889, 4942
Offset: 1

Views

Author

Klaus Brockhaus, Jul 07 2001

Keywords

Comments

Subsequence of A023108.

Examples

			The trajectory of 394 reaches 887 in one step and 887 is a term in the trajectory of 196, so 394 belongs to the present sequence. The corresponding term in A063050, giving the number of steps, accordingly is 1.
		

References

  • Popular Computing (Calabasas, CA), The 196 Problem, Vol. 3 (No. 30, Sep 1975), page PC30-9. Gives initial terms of this sequence.

Crossrefs

Programs

  • Mathematica
    Block[{nn = 10^2, s}, s = NestList[# + IntegerReverse@ # &, 196, nn]; Rest@ Select[Range@ 5000, Length@NestWhileList[# + IntegerReverse@ # &, #, FreeQ[s, #] &, 1, nn] <= nn &]] (* Michael De Vlieger, Jan 21 2018 *)

Extensions

Offset corrected by Sean A. Irvine, Apr 17 2023

A067034 Largest k such that A067030(n) = k + reverse(k).

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 10, 6, 7, 8, 9, 20, 30, 40, 50, 60, 70, 80, 90, 100, 91, 110, 93, 120, 94, 95, 130, 96, 97, 140, 98, 99, 150, 200, 160, 210, 170, 220, 180, 230, 190, 240, 250, 300, 260, 310, 270, 320, 280, 330, 290, 340, 350, 400, 360, 410, 370, 420, 380, 430
Offset: 0

Views

Author

Klaus Brockhaus, Dec 29 2001

Keywords

Examples

			a(12) = 30 since A067030(12) = 33 and 30 is the largest k such that 33 = k + reverse(k).
		

Crossrefs

Programs

  • ARIBAS
    function a067034(a,b: integer); var n,k,m,i,rev: integer; st,nst: string; begin for n := a to b do k := 0; m := -1; while k <= n do st := itoa(k); nst := ""; for i := 0 to length(st) - 1 do nst := concat(st[i],nst); end; rev := atoi(nst); if n = k + rev then m := k; end; inc(k); end; if m >= 0 then write(m,","); end; end; end; a067034(0,500);

A061563 Start with n; add to itself with digits reversed; if palindrome, stop; otherwise repeat; a(n) gives palindrome at which it stops, or -1 if no palindrome is ever reached.

Original entry on oeis.org

0, 2, 4, 6, 8, 11, 33, 55, 77, 99, 11, 22, 33, 44, 55, 66, 77, 88, 99, 121, 22, 33, 44, 55, 66, 77, 88, 99, 121, 121, 33, 44, 55, 66, 77, 88, 99, 121, 121, 363, 44, 55, 66, 77, 88, 99, 121, 121, 363, 484, 55, 66, 77, 88, 99, 121, 121, 363, 484, 1111, 66, 77, 88, 99, 121
Offset: 0

Views

Author

N. J. A. Sloane, May 18 2001

Keywords

Comments

It is believed that n = 196 is the smallest integer which never reaches a palindrome.

Examples

			19 -> 19 + 91 = 110 -> 110 + 011 = 121, so a(19) = 121.
		

Crossrefs

Cf. A033865. A016016 (number of steps), A023109, A006950, A023108.

Programs

  • ARIBAS
    var st: stack; test: boolean; end; for k := 0 to 60 do n := k; test := true; while test do n := n + int_reverse(n); test := n <> int_reverse(n); end; stack_push(st,n); end; stack2array(st);
  • Mathematica
    tol = 1000; r[n_] := FromDigits[Reverse[IntegerDigits[n]]]; 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, 64}] (* Jayanta Basu, Jul 11 2013 *)
    Table[Module[{k=n+IntegerReverse[n]},While[k!=IntegerReverse[k],k=k+IntegerReverse[k]];k],{n,0,70}] (* The program uses the IntegerReverse function from Mathematica version 10 *) (* Harvey P. Dale, Jul 19 2016 *)

Extensions

Corrected and extended by Klaus Brockhaus, May 20 2001
More terms from Ray Chandler, Jul 25 2003

A067033 Smallest k such that A067030(n) = k + reverse(k).

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 10, 6, 7, 8, 9, 11, 12, 13, 14, 15, 16, 17, 18, 100, 19, 29, 39, 120, 49, 59, 130, 69, 79, 140, 89, 99, 150, 101, 160, 111, 170, 121, 180, 131, 190, 141, 151, 102, 161, 112, 171, 122, 181, 132, 191, 142, 152, 103, 162, 113, 172, 123, 182, 133, 192
Offset: 0

Views

Author

Klaus Brockhaus, Dec 29 2001

Keywords

Examples

			a(12) = 12 since A067030(12) = 33 and 12 is the smallest k such that 33 = k + reverse(k).
		

Crossrefs

Programs

  • ARIBAS
    function a067033(a,b: integer); var n,k,i,rev: integer; st,nst: string; begin for n := a to b do k := 0; while k <= n do st := itoa(k); nst := ""; for i := 0 to length(st) - 1 do nst := concat(st[i],nst); end; rev := atoi(nst); if n = k + rev then write(k,",") k := n + 1; else inc(k); end; end; end; end; a067033(0,500);

A062130 A062128 written in base 10.

Original entry on oeis.org

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

Views

Author

Klaus Brockhaus, Jun 06 2001

Keywords

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; 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 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 *)
    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, 80}] (* Robert Price, Oct 14 2019 *)

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

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 *)

A063433 'Reverse and Add!' trajectory of 10577.

Original entry on oeis.org

10577, 88078, 175166, 836737, 1574375, 7309126, 13528163, 49710694, 99312488, 187733887, 976071668, 1842242347, 9274664828, 17559329557, 93151725128, 175304440267, 937348843838, 1775697687577, 9533565653348, 17967131306707
Offset: 0

Views

Author

Klaus Brockhaus, Jul 20 2001

Keywords

Examples

			a(1) = 10577 + 77501 = 88078.
		

Crossrefs

Programs

  • ARIBAS
    m := 10577; stop := 20; c := 0; rev := int_reverse(m); while m <> rev and c < stop do inc(c); write(m," "); m := m + rev; rev := int_reverse(m); end;
    
  • Haskell
    a063433 n = a063433_list !! n
    a063433_list = iterate a056964 10577 -- Reinhard Zumkeller, Sep 22 2011
  • Mathematica
    NestList[#+FromDigits[Reverse[IntegerDigits[#]]]&,10577, 20]  (* Harvey P. Dale, Apr 03 2011 *)
  • PARI
    Rev(x)= { local(d,r); r=0; while (x>0, d=x-10*(x\10); x\=10; r=r*10 + d); return(r) }
    { for (n=0, 200, if (n, a+=Rev(a), a=10577); write("b063433.txt", n, " ", a) ) } \\ Harry J. Smith, Aug 21 2009
    

A063051 'Reverse and Add!' trajectory of 879.

Original entry on oeis.org

879, 1857, 9438, 17787, 96558, 182127, 903408, 1707717, 8884788, 17759676, 85455447, 159910905, 668930856, 1326970722, 3597766953, 7194444906, 13288889823, 46187778054, 91275556218, 172541113437, 906852258708
Offset: 0

Views

Author

Klaus Brockhaus, Jul 07 2001

Keywords

Examples

			a(1) = 879 + 978 = 1857.
		

Crossrefs

Programs

  • ARIBAS
    m := 879; stop := 25; c := 0; rev := int_reverse(m); while m <> rev and c < stop do inc(c); write(m," "); m := m + rev; rev := int_reverse(m); end;
    
  • Haskell
    a033651 n = a033651_list !! n
    a033651_list = iterate a056964 9 -- Reinhard Zumkeller, Sep 22 2011
  • Mathematica
    NestList[# + FromDigits[Reverse[IntegerDigits[#]]]&, 879, 40] (* Vincenzo Librandi, Sep 23 2013 *)
  • PARI
    Rev(x)= { local(d); r=0; while (x>0, d=x-10*(x\10); x\=10; r=r*10 + d); return(r) }
    { for (n=0, 200, if (n, a+=Rev(a), a=879); write("b063051.txt", n, " ", a) ) } \\ Harry J. Smith, Aug 16 2009
    
Previous Showing 11-20 of 42 results. Next