A267086 Numbers such that the number formed by digits in even positions divides, or is divisible by, the number formed by the digits in odd positions; zero allowed.
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 24, 26, 28, 30, 31, 33, 36, 39, 40, 41, 42, 44, 48, 50, 51, 55, 60, 61, 62, 63, 66, 70, 71, 77, 80, 81, 82, 84, 88, 90, 91, 93, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 122, 124, 126, 128, 132, 135
Offset: 1
Examples
12 is in the sequence because 1 divides 2. 213 is in the sequence because 1 divides 23. 1020 is in the sequence because 12 divides 00 = 0. (Any number divides 0 therefore any number which has every other digit equal to zero is in the sequence.)
Links
- Robert Israel, Table of n, a(n) for n = 1..10000
- E. Angelini, Integears, SeqFan list, Jan. 10, 2016.
Programs
-
Maple
G:= proc(n) option remember; local t,r; t:= n mod 10; r:= procname((n-t)/10); [r[2],r[1]*10+t] end proc: G(0):= [0,0]: filter:= proc(n) local r; r:= G(n); has(r,0) or (max(r) mod min(r) = 0) end proc: select(filter, [$0..1000]); # Robert Israel, Jan 11 2016
-
Mathematica
{0}~Join~Select[Range@ 135, Total@ Boole@ Map[ReplaceAll[List -> Divisible], {#, Reverse@ #} /. {, 0} -> Nothing] &@ Map[FromDigits@ Reverse@ # &, {Map[First, #], Map[Last, #]}] &@ Which[Length@ # < 2, {#}, EvenQ@ Length@ #, Partition[#, 2, 2], True, Append[Partition[#, 2, 2], {Last@ #, 0}]] &@ Reverse@ IntegerDigits@ # > 0 &] (* _Michael De Vlieger, Jan 11 2016 *)
-
PARI
is(n,d=digits(n))={if(n=d*matrix(#d,2,z,s,if(z==Mod(s,2),10^((#d-z)\2))), n[2] && n[1]%n[2]==0 || n[2]%n[1]==0, 1)}
Comments