login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A096768 Numbers n of the form k + reverse(k) for two or more values of k. 2

%I #18 Oct 01 2016 12:15:24

%S 22,33,44,55,66,77,88,99,110,121,132,143,154,165,176,187,202,222,242,

%T 262,282,302,303,322,323,342,343,362,363,382,383,403,404,423,424,443,

%U 444,463,464,483,484,504,505,524,525,544,545,564,565,584,585,605,606

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

%H N. J. A. Sloane, <a href="/A096768/b096768.txt">Table of n, a(n) for n = 1..2106</a>

%H <a href="/index/Res#RAA">Index entries for sequences related to Reverse and Add!</a>

%e 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}).

%p 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;

%p # Maple program from _N. J. A. Sloane_, Mar 07 2016. Assumes digrev (from the "transforms" file) is available:

%p M:=1000; b := Array(1..M,0);

%p for n from 1 to M do

%p t1:=n+digrev(n);

%p if t1 <= M then b[t1]:=b[t1]+1; fi;

%p od:

%p ans:=[];

%p for n from 1 to M do

%p if b[n]>=2 then ans:=[op(ans),n]; fi; od:

%p ans;

%t M = 10^3; digrev[n_] := IntegerDigits[n] // Reverse // FromDigits; Clear[b]; b[_] = 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 *)

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

%K base,easy,nonn

%O 1,1

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

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 23 01:19 EDT 2024. Contains 371906 sequences. (Running on oeis4.)