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.

Original entry on oeis.org

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
Offset: 0

Views

Author

Michel Lagneau, Feb 03 2011

Keywords

Examples

			258 is in the sequence because 258 + 852 = 1110.
		

Crossrefs

Cf. A056964.

Programs

  • 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 *)
  • PARI
    isok(k) = if (k, vecmax(digits(k+fromdigits(Vecrev(digits(k))))) == 1, 1); \\ Michel Marcus, May 01 2021
  • Perl
    for (my $k = 1; $k < 10000; $k++) {print "$k, " if (($k + reverse($k)) =~ m/^[01]+$/)} # Charles R Greathouse IV, Feb 04 2011
    
  • Sage
    reverse = lambda n: Integer(str(n)[::-1],base=10)
    is_A185440 = lambda n: set((n+reverse(n)).digits()) <= set([0, 1])
    a = filter(is_A185440, [0..10000]) # D. S. McNeil, Feb 04 2011