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 21-30 of 70 results. Next

A072140 The period length of the 'Reverse and Subtract' trajectory of n is greater than 1.

Original entry on oeis.org

1012, 1023, 1034, 1045, 1067, 1078, 1089, 1100, 1122, 1133, 1144, 1155, 1177, 1188, 1199, 1210, 1232, 1243, 1254, 1265, 1287, 1298, 1320, 1342, 1353, 1364, 1375, 1397, 1408, 1430, 1452, 1463, 1474, 1485, 1507, 1518, 1540, 1562, 1573, 1584, 1595, 1606
Offset: 1

Views

Author

Klaus Brockhaus, Jun 24 2002

Keywords

Comments

'Reverse and Subtract' (cf. A072137) is defined by x -> |x - reverse(x)|. There is no number k > 0 such that |k - reverse(k)| = k, so 0 is the only period with length 1. Consequently this sequence consists of the numbers n such that repeated application of 'Reverse and Subtract' does not lead to a palindrome. It is an analog of A023108, which uses 'Reverse and Add'. - A072141, A072142, A072143 give the numbers which generate periods of length 2, 14, 22 respectively.

Examples

			1012 -> |1012 - 2101| = 1089 -> |1089 - 9801| = 8712 -> |8712 - 2178| = 6534 -> |6534 - 4356| = 2178 -> |2178 - 8712| = 6534; the period of the trajectory is 6534, 2178 and a palindrome is never reached.
		

Crossrefs

Programs

  • Haskell
    import Data.List (find, findIndices, inits)
    import Data.Maybe (fromJust)
    spanCycle :: Eq a => (a -> a) -> a -> ([a],[a])
    spanCycle f x = fromJust $ find (not . null . snd) $
                               zipWith (span . (/=)) xs $ inits xs
                    where xs = iterate f x
    a072140_list = findIndices (> 1) $
                   map (length . snd . spanCycle (abs . a056965)) [0..]
    -- eop.
    -- Reinhard Zumkeller, Oct 24 2010

A088753 Numbers k such that the Reverse and Add! trajectory of k (presumably) does not reach a palindrome (with the exception of k itself) and does not join the trajectory of any term m < k.

Original entry on oeis.org

196, 879, 1997, 7059, 9999, 10553, 10563, 10577, 10583, 10585, 10638, 10663, 10668, 10697, 10715, 10728, 10735, 10746, 10748, 10783, 10785, 10787, 10788, 10877, 10883, 10963, 10965, 10969, 10977, 10983, 10985, 12797, 12898, 13097, 13197, 13694, 14096, 14698, 15297, 15597, 18598, 18798
Offset: 1

Views

Author

Klaus Brockhaus, Nov 04 2003

Keywords

Comments

Although the starting number k is regarded as part of the trajectory, it is allowed to be palindromic. Hence palindromes are not excluded from the sequence. A063048 is obtained if palindromes are excluded. The smallest term in A088753 but not in A063048 is 9999, the smallest term in A063048 but not in A088753 is 19098.
W. VanLandingham and others have computed nearly 10^7 terms (all terms < 10^14), cf. W. VanLandingham, 196 and Other Lychrel Numbers.
From M. F. Hasler, Apr 13 2019: (Start)
Lychrel numbers listed here are also called "seeds", in contrast to Kin numbers A023108 which include all terms in the orbits of the former.
It is not easy to determine whether the orbit of a given term will never merge into the orbit of an earlier term. It seems that the property of "disjoint orbit" is as conjectural as the property of not reaching a palindrome. One could specify a "search limit" in order to get a well-defined sequence. The given list of terms has been checked and extended by considering the orbits up to members of size <= 10^199 at least. Given that the number increases by a factor 10 roughly every 2.416 iterations, this corresponds to about 500 iterations. (End)

Examples

			From _M. F. Hasler_, Apr 13 2019: (Start)
All numbers < 196 quickly reach a palindrome under iterations of the reverse-and-add function A056964, cf. A033665.
a(1) = 196 is the smallest integer which appears to never reach a palindrome (checked up to 10^9 iterations!).
Next, A056964(196) = 196 + 691 = 887 is in the orbit of 196 and will therefore never reach a palindrome if 196 does not. However, we do not list this term in this sequence because it is in the orbit of the smaller term 196.
Similarly, 295 + 592 = 887 = A056964(196). Therefore, 295 will also never reach a palindrome if 196 (and therefore 887) doesn't. But again we will not list this number, because its orbit merges into that of the smaller term 196.
The next number which appears to be a Lychrel and has an orbit (conjectured to be) disjoint with that of 196 is 897 = a(2). (End)
		

Crossrefs

Cf. A063048 (variant excluding palindromes), A023108 (Kin numbers), A056964 (reverse-and-add), A006960 (orbit of 196), A033665 (steps to reach a palindrome), A061563 (terminating palindrome of n's orbit), A002113 (palindromes).

Programs

  • Mathematica
    limit = 10^3; (* Assumes that there is no palindrome if none is found before "limit" iterations *)
    utraj = {};
    Select[Range[0,
      20000], (np = # + IntegerReverse[#];
       x = NestWhileList[ # + IntegerReverse[#] &, np, ! PalindromeQ[#] &, 1, limit];
       If[Length[x] >= limit  && Intersection[x, utraj] == {},
        utraj = Union[utraj, x, {np}]; True,
    utraj = Union[utraj, x, {np}]]) &] (* Robert Price, Oct 16 2019 *)
  • PARI
    A088753_upto(LIM=2e4,M=1e199)={my(U=[],a=List());for(n=1,LIM, my(t=n); while( tA002113(t=A056964(t)) && next(2)); setsearch(U,t) && next; U=setunion(U,[t]); print1(n","); listput(a,n)); Set(a)} \\ M. F. Hasler, Apr 13 2019

Extensions

Edited by M. F. Hasler, Apr 13 2019

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

A075420 Trajectory of n under the Reverse and Add! operation carried out in base 4 (presumably) does not reach a palindrome.

Original entry on oeis.org

290, 318, 378, 381, 438, 444, 462, 498, 501, 504, 510, 545, 567, 573, 627, 633, 636, 639, 693, 696, 699, 717, 719, 732, 751, 753, 756, 759, 765, 775, 795, 799, 800, 822, 823, 828, 835, 847, 859, 882, 883, 888, 894, 895, 915, 919, 927, 948, 954, 967, 972
Offset: 1

Views

Author

Klaus Brockhaus, Sep 18 2002

Keywords

Comments

Base-4 analog of A023108 (base 10) and A066059 (base 2).

Crossrefs

Programs

  • Mathematica
    limit = 10^3; (* Assumes that there is no palindrome if none is found before "limit" iterations *)
    Select[Range[1000],
    Length@NestWhileList[# + IntegerReverse[#, 4] &, #, # !=
    IntegerReverse[#, 4]  &, 1, limit] == limit + 1 &] (* Robert Price, Oct 16 2019 *)
  • PARI
    {stop=1000; for(n=1,980,k=n; c=0; while(c0,d=divrem(a,4); a=d[1]; rev=4*rev+d[2]); if(rev==k,c=stop+1,k=k+rev; c++)); if(c==stop,print1(n,",")))}

Extensions

Offset changed to 1 by A.H.M. Smeets, Feb 10 2019

A077404 Trajectory of n under the Reverse and Add! operation carried out in base 3 (presumably) does not reach a palindrome.

Original entry on oeis.org

103, 127, 167, 176, 180, 183, 185, 191, 197, 200, 206, 207, 209, 215, 221, 230, 239, 291, 309, 318, 340, 358, 369, 376, 387, 394, 396, 413, 418, 431, 436, 449, 454, 467, 472, 582, 600, 618, 636, 655, 660, 673, 678, 691, 696, 709, 714, 746, 776, 803, 805
Offset: 1

Views

Author

Klaus Brockhaus, Nov 05 2002

Keywords

Comments

Base-3 analog of A066059 (base 2), A075420 (base 4) and A023108 (base 10).

Crossrefs

Programs

  • ARIBAS
    m := 900; stop := 1000; for n := 0 to m do c := 0; k := n; b := 1; while b do d := k; rev := 0; while d > 0 do rev := 3*rev + (d mod 3); d := d div 3; end; if k = rev or c = stop then b := 0; else k := k + rev; end; inc(c); end; if c > stop then write(n,","); end; end;
  • Mathematica
    limit = 10^3; (* Assumes that there is no palindrome if none is found before "limit" iterations *)
    Select[Range[805],
     Length@NestWhileList[# + IntegerReverse[#, 3] &, #, # !=
    IntegerReverse[#, 3]  &, 1, limit] == limit + 1 &] (* Robert Price, Oct 19 2019 *)

Extensions

Offset changed to 1 by A.H.M. Smeets, Feb 10 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
    

A345114 Numbers whose trajectories under the map x -> A345111(x) do not reach a palindrome (conjectured).

Original entry on oeis.org

49, 58, 59, 67, 68, 69, 76, 77, 78, 79, 85, 86, 87, 88, 94, 95, 96, 97, 103, 114, 115, 116, 117, 119, 121, 124, 125, 126, 128, 129, 131, 134, 135, 137, 138, 139, 141, 142, 143, 146, 148, 149, 151, 153, 154, 155, 157, 158, 159, 160, 161, 162, 163, 164, 165, 168
Offset: 1

Views

Author

Felix Fröhlich, Jun 09 2021

Keywords

Comments

The trajectories of the given terms do not reach a palindrome in 10000 (10^4) or fewer steps. The trajectory of 49 does not reach a palindrome in 100000 (10^5) or fewer steps.

Crossrefs

Cf. A023108 (analog for the map x -> A056964(x)), A345110, A345111, A345112, A345113, A345115.

Programs

  • PARI
    eva(n) = subst(Pol(n), x, 10)
    rot(vec) = if(#vec < 2, return(vec)); my(s=concat(Str(2), ".."), v=[]); s=concat(s, Str(#vec)); v=vecextract(vec, s); v=concat(v, vec[1]); v
    a345112(n, bound) = my(x=n, i=0); while(1, x=x+eva(rot(digits(x))); i++; if(digits(x)==Vecrev(digits(x)), break); if(i > bound, return(-1))); i
    is(n) = a345112(n, 10000)==-1
    
  • Python
    def pal(s): return s == s[::-1]
    def rotl(s): return s[1:] + s[0]
    def A345111(n): return n + int(rotl(str(n)))
    def A345112_bd(n, bd=10000):
        i, iter, seen = 0, n, set()
        while not (iter > n and pal(str(iter))) and iter not in seen and i < bd:
            seen.add(iter)
            i, iter = i+1, A345111(iter)
        return i if iter > n and pal(str(iter)) else 0
    def aupto(lim, bd=10000):
        return [n for n in range(1, lim+1) if A345112_bd(n, bd=bd) == 0]
    print(aupto(168, bd=100)) # Michael S. Branicky, Jun 09 2021

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
    

A063057 'Reverse and Add!' trajectory of 7059.

Original entry on oeis.org

7059, 16566, 83127, 155265, 717816, 1336533, 4692864, 9375828, 17661567, 94178238, 177465387, 961030158, 1812060327, 9042662508, 17095324917, 89037683988, 177976357086, 858730036857, 1617360074715, 6792060711876
Offset: 0

Views

Author

Klaus Brockhaus, Jul 07 2001

Keywords

Examples

			a(1) = 7059 + 9507 = 16566.
		

Crossrefs

Programs

  • ARIBAS
    m := 7059; 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
    a063057 n = a063057_list !! n
    a063057_list = iterate a056964 7059 -- Reinhard Zumkeller, Sep 22 2011
  • Mathematica
    NestList[# + FromDigits[Reverse[IntegerDigits[#]]]&, 7059, 40] (* Vincenzo Librandi, May 03 2014 *)

A063054 'Reverse and Add!' trajectory of 1997.

Original entry on oeis.org

1997, 9988, 18887, 97768, 184547, 930028, 1750067, 9350638, 17711177, 94822948, 179745797, 977293768, 1844686547, 9301551028, 17503102067, 93523232638, 177146465177, 948711106948, 1798312224797, 9772534363768, 18446168716547
Offset: 0

Views

Author

Klaus Brockhaus, Jul 07 2001

Keywords

Examples

			a(1) = 1997 + 7991 = 9988.
		

Crossrefs

Programs

  • ARIBAS
    m := 1997; 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
    a063054 n = a063054_list !! n
    a063054_list = iterate a056964 1997 -- Reinhard Zumkeller, Sep 22 2011
  • Mathematica
    NestList[ #+FromDigits[ Reverse[ IntegerDigits[ # ] ] ]&, 1997, 25 ]
    NestList[#+IntegerReverse[#]&,1997,25] (* Harvey P. Dale, Jul 15 2025 *)
Previous Showing 21-30 of 70 results. Next