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.

A185440 Numbers k such that the decimal digits of k + reverse(k) are 0 or 1.

This page as a plain text file.
%I A185440 #23 Sep 30 2023 16:31:57
%S A185440 0,5,10,19,28,37,46,55,64,73,82,91,100,109,159,208,209,258,307,308,
%T A185440 357,406,407,456,505,506,555,604,605,654,703,704,753,802,803,852,901,
%U A185440 902,951,1000,1009,1010,1099,1100,1189,1199,1279,1289,1369,1379
%N A185440 Numbers k such that the decimal digits of k + reverse(k) are 0 or 1.
%H A185440 Daniel Starodubtsev, <a href="/A185440/b185440.txt">Table of n, a(n) for n = 0..10000</a>
%e A185440 258 is in the sequence because 258 + 852 = 1110.
%p A185440 with(numtheory): for i from 0 to 2000 do: ii:=0:s1:=0:ll:=length(i):for
%p A185440   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:
%p A185440   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
%p A185440   : if u=0 or u=1 then ii:=ii+1:else fi:od:if ii=l then printf(`%d, `,i):else
%p A185440   fi:od:
%t A185440 Select[Range[0,2000],Max[IntegerDigits[# +IntegerReverse[#]]]<2&] (* _Harvey P. Dale_, Sep 30 2023 *)
%o A185440 (Sage)
%o A185440 reverse = lambda n: Integer(str(n)[::-1],base=10)
%o A185440 is_A185440 = lambda n: set((n+reverse(n)).digits()) <= set([0, 1])
%o A185440 a = filter(is_A185440, [0..10000]) # _D. S. McNeil_, Feb 04 2011
%o A185440 (Perl) for (my $k = 1; $k < 10000; $k++) {print "$k, " if (($k + reverse($k)) =~ m/^[01]+$/)} # _Charles R Greathouse IV_, Feb 04 2011
%o A185440 (PARI) isok(k) = if (k, vecmax(digits(k+fromdigits(Vecrev(digits(k))))) == 1, 1); \\ _Michel Marcus_, May 01 2021
%Y A185440 Cf. A056964.
%K A185440 nonn,base
%O A185440 0,2
%A A185440 _Michel Lagneau_, Feb 03 2011