A249647 Numbers n that divide the concatenation of n+1 and n-1.
1, 3, 9, 11, 33, 99, 111, 333, 999, 1111, 3333, 9999, 11111, 33333, 99999, 111111, 142857, 333333, 999999, 1111111, 3333333, 9999999, 11111111, 33333333, 99999999, 111111111
Offset: 1
Examples
3 belongs to this sequence as 3 divides 42, 11 belongs to this sequence as 11 divides 1210. 9 belongs to this sequence as 9 divides the concatenation of 10 and 8, i.e., 108.
Links
- Robert Israel, Table of n, a(n) for n = 1..3163
Crossrefs
Cf. A069871.
Programs
-
Maple
with(numtheory): P:=proc(q) local n; for n from 1 to q do if type(((n+1)*10^(ilog10(n-1)+1)+n-1)/n,integer) then print(n); fi; od; end: P(10^15); # alternative: seq(op(select(type, [seq((10^d-1)/k, k=[9,7,3,1])],integer)),d=1..20); # Robert Israel, Jan 06 2016
-
Mathematica
Select[Range[2, 10^7], Divisible[FromDigits[IntegerDigits[# + 1]~Join~IntegerDigits[# - 1]], #] &] (* Michael De Vlieger, Jan 06 2016 *)
-
PARI
for(n=1,10^8, s=concat(Str(n+1),Str(n-1));if(!(eval(s)%n),print1(n,", "))) \\ Derek Orr, Nov 03 2014
Formula
a(n) = 1000001*a(n-19) + 1000000*a(n-38). - Robert Israel, Jan 06 2016
Extensions
a(23)-a(25) from Derek Orr, Nov 03 2014
Comments