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

A067030 Numbers of the form k + reverse(k) for at least one k.

Original entry on oeis.org

0, 2, 4, 6, 8, 10, 11, 12, 14, 16, 18, 22, 33, 44, 55, 66, 77, 88, 99, 101, 110, 121, 132, 141, 143, 154, 161, 165, 176, 181, 187, 198, 201, 202, 221, 222, 241, 242, 261, 262, 281, 282, 302, 303, 322, 323, 342, 343, 362, 363, 382, 383, 403, 404, 423, 424, 443
Offset: 0

Views

Author

Klaus Brockhaus, Dec 29 2001

Keywords

Comments

From Avik Roy (avik_3.1416(AT)yahoo.co.in), Feb 02 2009: (Start)
Any (k+1)-digit number m can be represented as
m = Sum_{i=0..k} (ai*10^i).
Reverse(m) = Sum_{i=0..k} (ai*10^(k-i)).
m+Reverse(m) = Sum_{i=0..k} (ai*(10^i+10^(k-i))).
The last formula can produce all the terms of this sequence; the order of terms is explicitly determined by the order of ai's (repetition of terms might not be avoided). (End)

Examples

			0 belongs to the sequence since 0 + 0 = 0;
33 belongs to the sequence since 12 + 21 = 33.
		

Crossrefs

Programs

  • ARIBAS
    function Reverse(n: integer): integer; var i: integer; str, rev: string;
    begin str := itoa(n); rev := "";
    for i := 0 to length(str)-1 do rev := concat(str[i], rev); end;
    return atoi(rev); end Reverse;
    function A067030(a, b: integer); var k, n: integer;
    begin for n := a to b do k := 0; while k <= n do
    if n = k+Reverse(k) then write(n, ", "); break; else inc(k); end;
    end; end; end A067030;
    A067030(0, 500) (* revised by Klaus Brockhaus, May 04 2011 *).
    
  • Magma
    A067030:=function(a, b); S:=[]; for n in [a..b] do k:=0; while k le n do if n eq k+Seqint(Reverse(Intseq(k))) then Append(~S, n); break; else k+:=1; end if; end while; end for; return S; end function; A067030(0, 500); // Klaus Brockhaus, May 04 2011
    
  • Mathematica
    M = 10^3; digrev[n_] := IntegerDigits[n] // Reverse // FromDigits; Clear[b]; b[A067030%20=%20Join%5B%7B0%7D,%20Reap%5BFor%5Bn%20=%201,%20n%20%3C=%20M,%20n++,%20If%5Bb%5Bn%5D%20%3E=%201,%20Sow%5Bn%5D%5D%5D%5D%5B%5B2,%201%5D%5D%5D%20(*%20_Jean-Fran%C3%A7ois%20Alcover">] = 0; For[n = 1, n <= M, n++, t1 = n + digrev[n]; If[t1 <= M, b[t1] = b[t1] + 1]]; A067030 = Join[{0}, Reap[For[n = 1, n <= M, n++, If[b[n] >= 1, Sow[n]]]][[2, 1]]] (* _Jean-François Alcover, Oct 01 2016, after N. J. A. Sloane's Maple code in A072040 *)
    max = 1000; l = ConstantArray[0, max]; Do[s = n + IntegerReverse@n; If[s <= max, l[[s]]++], {n, max}]; Flatten@{0, Position[l, ?(# != 0 &)]} (* _Hans Rudolf Widmer, Dec 25 2022 *)
  • Python
    def aupto(lim): return sorted(set(t for t in (k + int(str(k)[::-1]) for k in range(lim+1)) if t <= lim))
    print(aupto(443)) # Michael S. Branicky, Dec 25 2022

A065198 Indices of record high values in A033665, ignoring those numbers that are believed never to reach a palindrome.

Original entry on oeis.org

0, 10, 19, 59, 69, 79, 89, 10548, 10677, 10833, 10911, 147996, 150296, 1000689, 1005744, 1007601, 7008899, 9008299, 100239862, 140669390, 1005499526, 10000442119, 10000761554, 10000853648, 10000973037, 10031199494, 10087799570, 1000006412206, 1090604591930, 1600005969190, 100000090745299, 100120849299260, 10000043099946481, 10078083499399210, 10442000392399960
Offset: 1

Views

Author

Klaus Brockhaus, Oct 20 2001

Keywords

Comments

Integers like 196, for which a palindrome is supposedly never reached, are disregarded. A065199 gives the corresponding records.
a(39) <= N = 12000700000025339936491 for which A033665(N) = 288, found on April 26, 2019 according to Doucette's web site. - M. F. Hasler, Feb 16 2020
From A.H.M. Smeets, Sep 18 2021: (Start)
Let d_0 d_1 d_2 ... d_n be the decimal digits of an (n+1)-digit number.
All numbers in this sequence seem to satisfy the following condition:
d_0 = "1" or d_n = "9", and for all k, 0 < k < floor((n-1)/2), d_k = "0" or d_k = "9" or d_(n-k) = "0" or d_(n-k) = "9".
As from this, N = 12000700000025339936491, does not seem to be a record-setting number in this sequence, i.e., there must exist a smaller number N with at least a delay of 288 to reach a palindromic number. (End)

Examples

			Starting with 89, 24 'Reverse and Add' steps are needed to reach a palindrome; starting with n < 89, fewer (at most 6, in fact) steps are needed. So 89 is a term.
		

Crossrefs

Programs

  • Mathematica
    limit = 10^3; (* Assumes that there is no palindrome if none is found before "limit" iterations *)
    best = -1; Select[Range[0, 1000], (np = #; i = 0;
       While[np != IntegerReverse[np] && i < limit,
        np = np + IntegerReverse[np]; i++];
    If[i >= limit, False, If[i > best, best = i; True]]) &] (* Robert Price, Oct 14 2019 *)
  • PARI
    my(m, M=-1); for(n=0,oo, if(MA033665(n, M+39), print1(n","); M=m)) \\ Only for illustration, not suitable for producing terms > 10^6, even with the custom search limit given as optional 2nd arg to A033665. - M. F. Hasler, Feb 16 2020

Extensions

Terms a(17) to a(21) from Sascha Kurz, Dec 05 2001
Terms a(22) ff. were taken from Jason Doucette, World records. - Klaus Brockhaus, Sep 24 2003
Offset changed to 1 by A.H.M. Smeets, Feb 14 2019
Edited by N. J. A. Sloane, Jul 16 2021

A065199 Record high values in A033665, ignoring those numbers that are believed never to reach a palindrome.

Original entry on oeis.org

0, 1, 2, 3, 4, 6, 24, 30, 53, 54, 55, 58, 64, 78, 79, 80, 82, 96, 97, 98, 109, 112, 113, 131, 135, 147, 149, 186, 187, 188, 198, 201, 232, 233, 236, 259, 260, 261
Offset: 1

Views

Author

Klaus Brockhaus, Oct 20 2001

Keywords

Comments

Records for the number of 'Reverse and Add' steps needed to reach a palindrome.
A065198 gives the corresponding starting points.

Examples

			Starting with 89, 24 'Reverse and Add' steps are needed to reach a palindrome; starting with n < 89, at most 6 steps are needed.
For n = A065198(21) = 1005499526, a(21) = 109 "reverse and add" operations are needed to reach a palindrome; for all smaller n, at most 98 steps are needed.
For n = A065198(31) ~ 10^14, a(31) = 198 "reverse and add" operations are needed to reach a palindrome; for all smaller n, at most 188 steps are needed.
For n = A065198(36) ~ 10^18, a(36) = 259 "reverse and add" operations are needed to reach a palindrome; for all smaller n, at most 236 steps are needed.
		

Crossrefs

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 <= 100000, n++,
    np = n; i = 0;
    While[np != IntegerReverse[np] && i < limit,
      np = np + IntegerReverse[np]; i++];
    If[i < limit && i > best, best = i; AppendTo[lst, i]]]; lst (* Robert Price, Oct 14 2019 *)
  • PARI
    my(m, M=-1); for(n=0, oo, (MA033665(n, M+39))&&print1(M=m", ")) \\ For illustration; becomes very slow for terms > 70, even with the "custom" search limit as optional 2nd arg to A033665. - M. F. Hasler, Feb 16 2020

Formula

a(n) = A033665(A065198(n)). - M. F. Hasler, Feb 16 2020

Extensions

Terms a(17) to a(21) from Sascha Kurz, Dec 05 2001
Terms a(22) onwards were taken from Jason Doucette, World records. - Klaus Brockhaus, Sep 24 2003
Terms a(36) to a(38) were taken from Jason Doucette, World records and added by A.H.M. Smeets, Feb 10 2019
Edited by N. J. A. Sloane, Jul 16 2021

A033665 Number of 'Reverse and Add' steps needed to reach a palindrome starting at n, or -1 if n never reaches a palindrome.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

Palindromes themselves are not 'Reverse and Add!'ed, so they yield a zero!
Numbers n that may have a(n) = -1 (i.e., potential Lychrel numbers) appear in A023108. - Michael De Vlieger, Jan 11 2018
Record indices and values are given in A065198 and A065199. - M. F. Hasler, Feb 16 2020

Examples

			19 -> 19+91 = 110 -> 110+011 = 121 = palindrome, took 2 steps, so a(19)=2.
n = 89 needs 24 steps to end up with the palindrome 8813200023188. See A240510. - _Wolfdieter Lang_, Jan 12 2018
		

References

  • D. Wells, The Penguin Dictionary of Curious and Interesting Numbers Penguin Books, 1987, pp. 142-143.

Crossrefs

Equals A030547(n) - 1.
Cf. A065198, A065199 (record indices & values).

Programs

  • Mathematica
    rev[n_]:=FromDigits[Reverse[IntegerDigits[n]]];radd[n_]:=n+rev[n];
    pal[n_]:=If[n==rev[n],True,False];
    raddN[n_]:=Length[NestWhileList[radd[#]&,n,pal[#]==False&]]-1;
    raddN/@Range[0,195] (* Ivan N. Ianakiev, Aug 31 2015 *)
    With[{nn = 10^3}, Array[-1 + Length@ NestWhileList[# + IntegerReverse@ # &, #, !PalindromeQ@ # &, 1, nn] /. k_ /; k == nn -> -1 &, 200]] (* Michael De Vlieger, Jan 11 2018 *)
  • PARI
    rev(n)={d=digits(n);p="";for(i=1,#d,p=concat(Str(d[i]),p));return(eval(p))}
    a(n)=if(n==rev(n),return(0));for(k=1,10^3,i=n+rev(n);if(rev(i)==i,return(k));n=i)
    n=0;while(n<100,print1(a(n),", ");n++) \\ Derek Orr, Jul 28 2014
    
  • PARI
    A033665(n,LIM=333)={-!for(i=0,LIM,my(r=A004086(n)); n==r&&return(i); n+=r)} \\ with {A004086(n)=fromdigits(Vecrev(digits(n)))}. The second optional arg is a search limit that could be taken smaller up to very large n, e.g., 99 for n < 10^9, 200 for n < 10^14, 250 for n < 10^18: see A065199 for the records and A065198 for the n's. - M. F. Hasler, Apr 13 2019, edited Feb 16 2020
    
  • Python
    A033665 = lambda n, LIM=333: next((i for i in range(LIM) if is_A002113(n) or not(n := A004086(n)+n)), -1) # The second, optional argument is a search limit, see above. - M. F. Hasler, May 23 2024

Extensions

More terms from Patrick De Geest, Jun 15 1998
I truncated the b-file at n=195, since the value of a(196) is not presently known (cf. A006960). The old b-files are now a-files. - N. J. A. Sloane, May 09 2015

A063048 Numbers n such that the Reverse and Add! trajectory of n (presumably) does not reach a palindrome and does not join the trajectory of any term m < n.

Original entry on oeis.org

196, 879, 1997, 7059, 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
Offset: 1

Views

Author

Klaus Brockhaus, Jul 07 2001, revised Nov 04 2003

Keywords

Comments

The starting number n is regarded as part of the trajectory, so palindromes are excluded from the sequence. A088753 is obtained if palindromes are not excluded. The smallest term in A063048 but not in A088753 is 19098, the smallest term in A088753 but not in A063048 is 9999.
Subsequence of A023108. Sequence A070788 is similarly defined, but palindromes are irrelevant. Corresponding sequences for other bases are A075252 (base 2), A077405 (base 3), A075421 (base 4).
If the trajectory of a number k joins the trajectory of a smaller number which is a term of the present sequence, then this occurs after very few Reverse and Add! steps (at most 8 for k < 100000, at most 10 for k < 1000000). On the other hand, the trajectories of the terms < 14000 do not join the trajectory of any smaller term within at least 1500 steps. This is the precise meaning of "presumably" in the definition.
The terms are rather unevenly distributed. They form clusters, especially above 10^4, 10^5, 10^6, ... . The interval from 10000 to 11000 for example contains 26 terms, whereas only two terms occur in the interval from 90000 to 100000.
It seems that if the most significant digit is not equal to 1, the least significant digit is always 9, while this does not hold for the Lychrel numbers as in A023108. - A.H.M. Smeets, Feb 18 2019
From A.H.M. Smeets, Sep 18 2021: (Start)
Let d_0 d_1 d_2 ... d_n be the decimal digits of an (n+1)-digit number.
All numbers in this sequence seem to satisfy the following condition:
d_0 = "1" or d_n = "9", and for all k, 0 < k < floor((n-1)/2), d_k = "0" or d_k = "9" or d_(n-k) = "0" or d_(n-k) = "9".
The plot log_10(a(n)) versus log_10(n) shows a stepwise behavior. However, the global behavior seems to be a straight line with slope e/(e-1) (= A185393). This slope is also obtained for the seeds in the Reverse and Add! problem in other bases. (End)

Examples

			1997 is a term since the trajectory of 1997 (presumably) does not lead to a number which occurs in the trajectory of 196 or of 879 (actually checked for the first 10000 terms of these trajectories). The trajectory of 1997 joins the trajectory of 106 at 97768 (cf. A070796), but 106 is not a term of the present sequence.
		

References

  • Daniel Lignon, Dictionnaire de (presque) tous les nombres entiers, Ellipses, Paris, 2012, 702 pages. See Entry 196.

Crossrefs

Programs

  • Mathematica
    limit = 10^3; (* Assumes that there is no palindrome if none is found before "limit" iterations *)
    utraj = {};
    Select[Range[0, 14000], (x = NestWhileList[ # + IntegerReverse[#] &, #, ! PalindromeQ[#] &, 1, limit];
       If[Length[x] >= limit && Intersection[x, utraj] == {},
        utraj = Union[utraj, x]; True,
    utraj = Union[utraj, x]]) &] (* Robert Price, Oct 16 2019 *)

A066057 'Reverse and Add' carried out in base 2 (cf. A062128); number of steps needed to reach a palindrome, or -1 if no palindrome is ever reached.

Original entry on oeis.org

0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 2, 1, 2, 1, 0, 1, 0, 1, 4, 5, 0, -1, 2, 1, 4, -1, 0, -1, 2, 1, 0, 1, 0, 1, -1, 1, -1, 1, 2, 1, -1, 1, 2, 3, 0, -1, -1, 1, -1, 3, 0, 1, 2, 3, 2, 1, 2, 3, 2, -1, -1, 1, 0, 1, 0, 1, -1, 1, 2, 1, 4, 3, 0, 11, -1, 5, -1, -1, 2, 1, 2, 1, 4, -1, 0, -1, 2, 5, -1, -1, 2, 3, 0, -1, -1, 1, -1, 3, 0, 1, 4, 1, 10, 11, -1, -1, 0, -1, 2, -1, 4
Offset: 0

Views

Author

Klaus Brockhaus, Dec 04 2001

Keywords

Comments

The analog of A033665 in base 2.

Examples

			10011 (19 in base 10) -> 10011 + 11001 = 101100 -> 101100 + 1101 = 111001 -> 111001 + 100111 = 1100000 -> 1100000 + 11 = 1100011 (palindrome) requires 4 steps, so a(19) = 4.
		

Crossrefs

Programs

  • ARIBAS
    function b2reverse(a: integer): integer; var n,i,rev: integer; begin n := bit_length(a); for i := 0 to n-1 do if bit_test(a,i) = 1 then rev := bit_set(rev,n-1-i); end; end; return rev; end; function a066057(mx,stop: integer); var c,k,m,rev: integer; begin for k := 0 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(c); else write(-1); end; write(" "); end; end; a066057(120,300);
  • 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, i], {n, 0, 111}] (* Robert Price, Oct 14 2019 *)

A067031 Numbers that are not of the form k + reverse(k) for any k.

Original entry on oeis.org

1, 3, 5, 7, 9, 13, 15, 17, 19, 20, 21, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87
Offset: 0

Views

Author

Klaus Brockhaus, Dec 29 2001

Keywords

Examples

			3 belongs to the sequence since there is no k such that k + reverse(k) = 3.
		

Crossrefs

Cf. A056964.
Complement of A067030.

Programs

  • ARIBAS
    function a067031(a,b: integer); var k,n,i,rev: integer; test: boolean; st,nst: string; begin for n := a to b do k := 0; test := 1; while test and 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 test := 0; else inc(k); end; end; if k > n then write(n,","); end; end; end; a067031(0,100);
  • Mathematica
    Module[{nn=100,rd},rd=Union[Table[n+FromDigits[ Reverse[ IntegerDigits[ n]]],{n,nn}]];Complement[Range[nn],rd]] (* Harvey P. Dale, Dec 16 2013 *)

A045876 Sum of different permutations of digits of n (leading 0's allowed).

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 11, 33, 44, 55, 66, 77, 88, 99, 110, 22, 33, 22, 55, 66, 77, 88, 99, 110, 121, 33, 44, 55, 33, 77, 88, 99, 110, 121, 132, 44, 55, 66, 77, 44, 99, 110, 121, 132, 143, 55, 66, 77, 88, 99, 55, 121, 132, 143, 154, 66, 77, 88, 99, 110, 121, 66, 143
Offset: 1

Views

Author

Keywords

Comments

Let the arithmetic mean of the digits of a 'D' digit number n be 'A', let 'N' = number of distinct numbers that can be formed by permuting the digits of n, and let 'I' = concatenation of 1 'D' times = (10^D-1)/9. then a(n) = A*N*I. E.g., let n = 324541, then A = (3+2+4+5+4+1)/6 = 19/6, N = 6!/(2!) = 360, I = 111111, and a(n) = A*N*I = (19/6)*(360)*(111111) = 126666540. - Amarnath Murthy, Jul 14 2003
It seems that the first person who studied the sum of different permutations of digits of a given number was the French scientist Eugène Aristide Marre (1823-1918). See links. - Bernard Schott, Dec 06 2012

References

  • Amarnath Murthy, An interesting result in combinatorics, Mathematics & Informatics Quarterly, Vol. 3, 1999, Bulgaria.

Crossrefs

Same beginning as A033865. Cf. A061147.

Programs

  • Maple
    f:= proc(x) local L,D,n,M,s,j;
      L:= convert(x,base,10);
      D:= [seq(numboccur(j,L),j=0..9)];
      n:= nops(L);
      M:= n!/mul(d!,d=D);
      s:= add(j*D[j+1],j=0..9);
      (10^n-1)*M/9/n*s
    end proc:
    map(f, [$1..100]); # Robert Israel, Jul 07 2015
  • Mathematica
    Table[Total[FromDigits /@ Permutations[IntegerDigits[n]]], {n, 100}] (* T. D. Noe, Dec 06 2012 *)
  • PARI
    A047726(n) = n=eval(Vec(Str(n))); (#n)!/prod(i=0, 9, sum(j=1, #n, n[j]==i)!);
    A055642(n) = #Str(n);
    A007953(n) = sumdigits(n);
    a(n) = ((10^A055642(n)-1)/9)*(A047726(n)*A007953(n)/A055642(n)); \\ Altug Alkan, Aug 29 2016
    
  • PARI
    A045876(n) = {my(d=digits(n), q=1, v, t=1); v = vecsort(d); for(i=1, #v-1, if(v[i]==v[i+1], t++, q*=binomial(i, t); t=1)); q*binomial(#v, t)*(10^#d-1)*vecsum(d)/9/#d} \\ David A. Corneth, Oct 06 2016

Formula

a(n) = ((10^A055642(n)-1)/9)*(A047726(n)*A007953(n)/A055642(n)). - Altug Alkan, Aug 29 2016

A065001 a(n) = (presumed) number of palindromes in the 'Reverse and Add!' trajectory of n, or -1 if this number is not finite.

Original entry on oeis.org

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

Views

Author

Klaus Brockhaus, Nov 01 2001

Keywords

Comments

Presumably a(196) = 0 (see A016016). Conjecture: There is no n > 0 such that the trajectory of n contains an infinite number of palindromes; the trajectory of n eventually leads to a term in the trajectory of some integer k which belongs to sequence A063048, i.e. whose trajectory (presumably) never leads to a palindrome.

Examples

			8, 77, 1111, 2222, 4444, 8888, 661166, 3654563 are the eight palindromes in the trajectory of 8 and 3654563 + 3654563 = 7309126 is the sixth term in the trajectory of 10577 (see A063433) which (presumably) never leads to a palindrome (see A063048), so a(8) = 8.
		

Crossrefs

Programs

  • ARIBAS
    maxarg := 120; stop := 500; for k := 1 to maxarg do n := k; count := 0; c := 0; while c < stop do if n = int_reverse(n) then inc(count); c := 0; end; inc(c); n := n + int_reverse(n); end; write(count," " ); end;

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 *)
Showing 1-10 of 42 results. Next