|
|
A185440
|
|
Numbers k such that the decimal digits of k + reverse(k) are 0 or 1.
|
|
1
|
|
|
0, 5, 10, 19, 28, 37, 46, 55, 64, 73, 82, 91, 100, 109, 159, 208, 209, 258, 307, 308, 357, 406, 407, 456, 505, 506, 555, 604, 605, 654, 703, 704, 753, 802, 803, 852, 901, 902, 951, 1000, 1009, 1010, 1099, 1100, 1189, 1199, 1279, 1289, 1369, 1379
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,2
|
|
LINKS
|
|
|
EXAMPLE
|
258 is in the sequence because 258 + 852 = 1110.
|
|
MAPLE
|
with(numtheory): for i from 0 to 2000 do: ii:=0:s1:=0:ll:=length(i):for
q from 0 to ll do:x:=iquo(i, 10^q):y:=irem(x, 10):s1:=s1+y*10^(ll-1-q): od:n:=i+s1:
l:=length(n):n0:=n:s:=0:for m from 0 to l-1 do:q:=n0:u:=irem(q, 10):v:=iquo(q, 10):n0:=v
: if u=0 or u=1 then ii:=ii+1:else fi:od:if ii=l then printf(`%d, `, i):else
fi:od:
|
|
MATHEMATICA
|
Select[Range[0, 2000], Max[IntegerDigits[# +IntegerReverse[#]]]<2&] (* Harvey P. Dale, Sep 30 2023 *)
|
|
PROG
|
(Sage)
reverse = lambda n: Integer(str(n)[::-1], base=10)
is_A185440 = lambda n: set((n+reverse(n)).digits()) <= set([0, 1])
(Perl) for (my $k = 1; $k < 10000; $k++) {print "$k, " if (($k + reverse($k)) =~ m/^[01]+$/)} # Charles R Greathouse IV, Feb 04 2011
(PARI) isok(k) = if (k, vecmax(digits(k+fromdigits(Vecrev(digits(k))))) == 1, 1); \\ Michel Marcus, May 01 2021
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|