login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A029479 Numbers k that divide the (left) concatenation of all numbers <= k written in base 10 (most significant digit on left). 2
1, 3, 9, 19, 27, 41, 103, 147, 189, 441, 567, 711, 6759, 15353, 24441, 59823, 209903, 1430217, 2848851, 2969973, 13358067, 146247471, 289542573, 1891846557, 2388085659, 4489093899, 5345125899, 5455876131, 9843149241 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
COMMENTS
No other terms below 10^10.
LINKS
EXAMPLE
19 is a term since 19181716151413121110987654321 is divisible by 19.
MATHEMATICA
b = 10; c = {}; Select[Range[10^4], Divisible[FromDigits[c = Join[IntegerDigits[#, b], c], b], #] &] (* Robert Price, Mar 12 2020 *)
Select[Range[134*10^5], Divisible[FromDigits[Flatten[IntegerDigits/@Range[#, 1, -1]]], #]&] (* Harvey P. Dale, Oct 09 2022 *)
PROG
(Python)
def concat_mod(base, k, mod):
total, offset, digits, n1 = 0, 0, 1, 1
while n1 <= k:
n2, p = min(n1*base-1, k), n1*base
# Compute ((p-1)*n2-1)*p**(n2-n1+1)-(n1-1)*p+n1 divided by (p-1)**2.
# Since (a//b)%mod == (a%(b*mod))//b, compute the numerator mod (p-1)**2*mod.
tmp = pow(p, n2-n1+1, (p-1)**2*mod)
tmp = ((p-1)*n2-1)*tmp-(n1-1)*p+n1
tmp = (tmp%((p-1)**2*mod))//(p-1)**2
total += tmp*pow(base, offset, mod)
offset, digits, n1 = offset+digits*(n2-n1+1), digits+1, p
return total%mod
for k in range(1, 10**10):
if concat_mod(10, k, k) == 0: print(k) # Jason Yuen, Jan 14 2024
CROSSREFS
Sequence in context: A069832 A057257 A029464 * A215803 A014869 A018495
KEYWORD
nonn,base,more
AUTHOR
EXTENSIONS
6759 from Andrew Gacek (andrew(AT)dgi.net), Feb 20 2000
More terms from Larry Reeves (larryr(AT)acm.org), May 24 2001
Edited and updated by Larry Reeves (larryr(AT)acm.org), Apr 12 2002
a(18)-a(21) from Max Alekseyev, May 15 2011
a(22)-a(29) from Jason Yuen, Jan 14 2024
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 19 10:56 EDT 2024. Contains 371791 sequences. (Running on oeis4.)