OFFSET
1,2
COMMENTS
"Lexicographically earliest" means in the sense of a sequence of integers, not digits.
No digit can be even or five. - Hans Havermann, Jul 02 2014 [Proof: if not, let d be the first digit in the sequence that is even or 5, and let Z be the concatenation of all earlier digits. But then Z is odd and does not end in 5, so is not divisible by d. Contradiction. - N. J. A. Sloane, Jul 03 2014] So any term must have only the odd digits {1, 3, 7, 9} (see A136333). - Robert G. Wilson v, Jul 02 2014
We choose the next term, a(n), to be the minimal number not already in the sequence such that the property "if a vertical line is drawn between any pair of adjacent digits, the number Z formed by the digits to the left of the line is divisible by the first digit following Z" holds.
So even if Z is prime, the next term can start with a 1.
So if Z is divisible by any d in {2,3,...,9} the next term can start with 1 or d, otherwise it must start with 1.
This sequence is missing A136333 terms 313, 319, 373, 379, 717, 737, 797, 913, 919, 939, 973, 979, 1313, ... The earliest occurrences of n-digit numbers are the repunits at indices 1, 2, 7, 15, 27, 97, 372, 939, 2164, 4781, 10851, 22779, 47056, ... The latest n-digit numbers and their indices are: (9,17), (17,52), (397,290), (1917,867), (19317,2003), (199117,7241), (1999117,17953), (19999997,44173), ... - Hans Havermann, Jul 04 2014, Jul 07 2014, Jul 15 2014
REFERENCES
Eric Angelini, Posting to Sequence Fans Mailing List, Jun 26 2014.
LINKS
Hans Havermann, Table of n, a(n) for n = 1..10850 (terms 1..1000 from Robert G. Wilson v)
EXAMPLE
After 1,11,3,7, let a(5) = x be the next term. Now 11137 = 7*37*43, so x must begin with 1 or 7. The candidates for x are therefore 12,13,...,19,71,72,,...,79,111,...
If x=12, we would get 1 11 3 7 12 ... but Z = 11371 is prime and is not divisible by 2, ..., 9. So x is not 12, ...,19. The next candidate is x=71, and this works. So a(5)=71.
MATHEMATICA
r=f=e={1, 3, 7, 9}; Do[e=10*e; f=Flatten[Table[e[[i]]+f, {i, 4}]]; r=Join[r, f], {9}]; r=Select[r, Intersection[Partition[IntegerDigits[#], 3, 1], IntegerDigits[{313, 319, 373, 379, 717, 737, 797, 913, 919, 939, 973, 979}]]=={}&]; t=0; Do[c=1; While[d=IntegerDigits[r[[c]]]; Union[Table[IntegerQ[(10^i*t+FromDigits[Take[d, i]])/d[[i+1]]], {i, 0, Length[d]-1}]]!={True}, c++]; Print[r[[c]]]; t=10^Length[d]*t+r[[c]]; r=Delete[r, c], {10850}] (* Hans Havermann, Jul 04 2014 *)
CROSSREFS
KEYWORD
nonn,base
AUTHOR
N. J. A. Sloane, Jul 02 2014
EXTENSIONS
Corrected and extended by Hans Havermann, Jul 02 2014
STATUS
approved
