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

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

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

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

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

A067035 n sets a new record for the number of integers k such that n = k + reverse(k).

Original entry on oeis.org

0, 22, 33, 44, 55, 66, 77, 88, 99, 1111, 2552, 2662, 2772, 2882, 2992, 3663, 3773, 3883, 3993, 4774, 4884, 4994, 5885, 5995, 6886, 6996, 7887, 7997, 8888, 8998, 9889, 9999, 199991, 258852, 259952, 268862, 269962, 278872, 279972, 288882, 289982
Offset: 1

Views

Author

Klaus Brockhaus, Dec 29 2001

Keywords

Comments

RECORDS transform of A067032. A067036 gives the corresponding records.
Are all terms palindromes? - David A. Corneth, Jan 16 2020

Examples

			33 belongs to the sequence because for three integers k (cf. A067032) we have 33 = k + reverse(k) and for m < 33 there are at most two integers j such that m = j + reverse(j).
		

Crossrefs

Extensions

Offset set to 1 by Giovanni Resta, Jan 16 2020

A067036 Records for the number of integers k such that an integer is of the form k + reverse(k).

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 16, 18, 20, 21, 24, 27, 30, 32, 36, 40, 45, 50, 54, 60, 63, 70, 72, 80, 81, 90, 100, 108, 120, 126, 140, 144, 160, 162, 180, 200, 210, 216, 240, 243, 270, 300, 320, 324, 360, 400, 405, 450, 500, 540, 600, 630, 700, 720, 800, 810
Offset: 1

Views

Author

Klaus Brockhaus, Dec 29 2001

Keywords

Comments

RECORDS transform of A067032. A067035 gives the corresponding integers at which these records are attained.

Examples

			3 is a record since there is an integer n (viz. 33, cf. A067032) such that for three integers k we have n = k + reverse(k) and for m < n there are at most two integers j such that m = j + reverse(j).
		

Crossrefs

Extensions

Offset set to 1 by Giovanni Resta, Jan 16 2020

A071265 Numbers which can be written in exactly two different ways as k + R(k) where R(k) is k reversed (A004086).

Original entry on oeis.org

22, 33, 165, 176, 202, 222, 242, 262, 282, 302, 303, 322, 323, 342, 343, 362, 363, 382, 383, 403, 423, 443, 463, 483, 1515, 1535, 1555, 1575, 1595, 1615, 1616, 1635, 1636, 1655, 1656, 1675, 1676, 1695, 1696, 1716, 1736, 1756, 1776, 1796, 2002, 2871, 3003
Offset: 1

Views

Author

Amarnath Murthy, Jun 01 2002

Keywords

Comments

The sums are unordered, so for example 12 + 21 is not counted as distinct from 21 + 12. - Sean A. Irvine, Jul 06 2024

Examples

			22 = 11 + 11 = 20 + 02, 202 =101 + 101 = 200 + 002.
		

Crossrefs

Extensions

More terms from Vladeta Jovovic and Klaus Brockhaus, Jun 03 2002
Offset corrected by Sean A. Irvine, Jul 06 2024

A067285 a(n) = smallest integer k such that k is not of the form m + reverse(m) for any m (cf. A067031) and A067030(n) occurs in the 'Reverse and Add' trajectory of k.

Original entry on oeis.org

0, 1, 1, 3, 1, 5, 5, 3, 7, 1, 9, 5, 3, 5, 7, 3, 1, 5, 9, 100, 7, 7, 3, 120, 49, 1, 130, 69, 5, 140, 89, 9, 150, 100, 160, 111, 170, 7, 180, 131, 190, 120, 151, 102, 130, 112, 171, 122, 140, 3, 191, 142, 152, 100, 162, 113, 172, 111, 182, 133, 192, 7, 153, 104, 131, 114
Offset: 0

Views

Author

Klaus Brockhaus, Feb 04 2002

Keywords

Comments

a(n) <= A067033(n).

Examples

			a(14) = 7, since A067030(14) = 55 and the five integers 7, 23, 32, 41, 50 are not of the form m + reverse(m) for any m, 55 occurs in the trajectory of each of them and 7 is the smallest one. a(25) = 1, since A067030(25) = 154 and the eleven integers 1, 25, 34, 43, 52, 59, 61, 68, 70, 86, 95 are not of the form m + reverse(m) for any m, 154 occurs in the trajectory of each of them and 1 is the smallest one.
		

Crossrefs

Showing 1-8 of 8 results.