A332580 a(n) = minimal positive k such that the concatenation of the decimal digits of n,n+1,...,n+k is divisible by n+k+1, or -1 if no such k exists.
1, 80, 1885, 6838, 1, 44, 13, 2, 1311, 18, 197, 20, 53, 134, 993, 44, 175, 124518, 263, 26, 107, 10, 5, 62, 15, 33172, 9, 14, 317, 708, 1501, 214, 37, 34, 67, 270, 19, 20188, 78277, 10738, 287, 2390, 695, 2783191412912, 3, 700, 8303, 350, 21, 100, 2249, 21326
Offset: 1
Examples
a(1) = 1 as '1' || '2' = '12', which is divisible by 3 (where || denotes decimal concatenation). a(2) = 80: the concatenation 2 || 3 || ... || 82 is 23456789101112131415161718192021222324252627282930313233343536373839\ 40414243444546474849505152535455565758596061626364656667686970717273747\ 576777879808182, which is divisible by 83. a(7) = 13 as '7' || '8' || '9' || '10' || '11' || '12' || ... || '20' = 7891011121314151617181920, which is divisible by 21. a(8) = 2 as '8' || '9' || '10' = 8910, which is divisible by 11.
Links
- Joseph Myers and Paul Zimmermann, Table of n, a(n) for n = 1..157
- M. A. Alekseyev, J. S. Myers, R. Schroeppel, S. R. Shannon, N. J. A. Sloane, and P. Zimmermann, Three Cousins of Recaman's Sequence, Fibonacci Quart. 60:3 (2022), 201-219 (preprint arXiv:2004:14000 [math.NT], 2021).
- Pierrick Gaudry, C program for partial check
- Joseph Myers and Paul Zimmermann, Table of n, a(n) for n <= 1000. The single remaining UNKNOWN entry at n = 158 either -1 or greater than 10^14.
- N. J. A. Sloane, Conant's Gasket, Recamán Variations, the Enots Wolley Sequence, and Stained Glass Windows, Experimental Math Seminar, Rutgers University, Sep 10 2020 (video of Zoom talk).
- Paul Zimmermann, A parallel version of Joseph's C program
Crossrefs
Programs
-
Maple
grow := proc(n,M) # searches out to a limit of M, returns [n,n+k] or [n,-1] if no k was found local R,i; R:=n; for i from n+1 to M do R:=R*10^length(i)+i; if (i mod 2) = 0 then if (R mod (i+1)) = 0 then return([n, i]); fi; fi; od: [n, -1]; end; for n from 1 to 100 do lprint(grow(n,20000)); od;
-
PARI
apply( {a(n,L=10^logint(n*10,10),c=n)= n%2||c=c*L+n+1; for(k=n+++n%2,oo, k
M. F. Hasler, Feb 20 2020
Extensions
Edited by Max Alekseyev, Dec 26 2024
Comments