OFFSET
1,2
COMMENTS
A069871 is a subset of this sequence.
All the numbers of the form (10^k - 1)/9, (10^k - 1)/3 and (10^k-1) are members.
Any concatenation of 142857 with itself is part of the sequence, too.
All integers of the form (10^d-1)/k where 1 <= k <= 9. - Robert Israel, Jan 06 2016
It appears that equivalent definitions are: (A) Numbers which divide the repunit of the same length, n | R(length(n)). (B) Numbers equal to one or more concatenations of one among {1, 3, 9, 142857}. Is there a proof for this? - M. F. Hasler, Jun 10 2016
LINKS
Robert Israel, Table of n, a(n) for n = 1..3163
FORMULA
a(n) = 1000001*a(n-19) + 1000000*a(n-38). - Robert Israel, Jan 06 2016
EXAMPLE
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.
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 *)
PROG
(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
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Paolo P. Lava, Nov 03 2014
EXTENSIONS
a(23)-a(25) from Derek Orr, Nov 03 2014
STATUS
approved