A210589 Numbers which, when divided by their first digit, have their last digit as remainder.
10, 20, 21, 30, 31, 32, 40, 41, 42, 43, 50, 51, 52, 53, 54, 60, 61, 62, 63, 64, 65, 70, 71, 72, 73, 74, 75, 76, 80, 81, 82, 83, 84, 85, 86, 87, 90, 91, 92, 93, 94, 95, 96, 97, 98, 100, 110, 120, 130, 140, 150, 160, 170, 180, 190, 200, 201, 210, 211, 220, 221, 230, 231, 240, 241
Offset: 1
Links
- Vincenzo Librandi, Table of n, a(n) for n = 1..7000
- Charles R Greathouse IV, in reply to E. Angelini, Re: Divided by first digit, have last digit as remainder, SeqFan list, Mar 21 2012
- Index entries for 10-automatic sequences.
Programs
-
Magma
[ n: n in [1..249] | n mod d[#d] eq d[1] where d is Intseq(n) ]; // Bruno Berselli, Mar 23 2012
-
Mathematica
ldrQ[n_]:=Module[{idn=IntegerDigits[n],f,l},f=First[idn];l=Last[idn];Mod[n,f]==l]; Select[Range[10000],ldrQ] (* Harvey P. Dale, Mar 21 2012 *)
-
PARI
is_A210589(x)=x%(x\10^(#Str(x)-1))==x%10
-
Python
def ok(n): s = str(n); return n > 0 and n%int(s[0]) == int(s[-1]) print([k for k in range(242) if ok(k)]) # Michael S. Branicky, Oct 20 2021
Comments