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.

A096768 Numbers n of the form k + reverse(k) for two or more values of k.

Original entry on oeis.org

22, 33, 44, 55, 66, 77, 88, 99, 110, 121, 132, 143, 154, 165, 176, 187, 202, 222, 242, 262, 282, 302, 303, 322, 323, 342, 343, 362, 363, 382, 383, 403, 404, 423, 424, 443, 444, 463, 464, 483, 484, 504, 505, 524, 525, 544, 545, 564, 565, 584, 585, 605, 606
Offset: 1

Views

Author

Chuck Seggelin (seqfan(AT)plastereddragon.com), Jul 08 2004

Keywords

Examples

			22 belongs to the sequence since 11 + 11 = 22 and 20 + 2 = 22 (k = {11, 20}); 33 belongs to the sequence since 12 + 21 = 33, 21 + 12 = 33 and 30 + 3 = 33 (k = {12, 21, 30}).
		

Crossrefs

Cf. A067030, A072040 (exactly two values of k).

Programs

  • Maple
    reverse:= proc (d) local n,m; m:=0;n:=d; while n>0 do m:=m*10+(n mod 10); n:=(n-(n mod 10))/10; od; m; end; P:={};P2:={};for i to 5000 do; if i>0 then; r:=i+reverse(i); rat:={r}; if P intersect rat = {} then P:=P union rat else P2:=P2 union rat fi; fi; od; P2;
    # Maple program from N. J. A. Sloane, Mar 07 2016. Assumes digrev (from the "transforms" file) is available:
    M:=1000; b := Array(1..M,0);
    for n from 1 to M do
    t1:=n+digrev(n);
    if t1 <= M then b[t1]:=b[t1]+1; fi;
    od:
    ans:=[];
    for n from 1 to M do
    if b[n]>=2 then ans:=[op(ans),n]; fi; od:
    ans;
  • Mathematica
    M = 10^3; digrev[n_] := IntegerDigits[n] // Reverse // FromDigits; Clear[b]; b[A096768%20=%20Reap%5BFor%5Bn%20=%201,%20n%20%3C=%20M,%20n++,%20If%5Bb%5Bn%5D%20%3E=%202,%20Sow%5Bn%5D%5D%5D%5D%5B%5B2,%201%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]]; A096768 = Reap[For[n = 1, n <= M, n++, If[b[n] >= 2, Sow[n]]]][[2, 1]] (* _Jean-François Alcover, Oct 01 2016, after N. J. A. Sloane's Maple code *)