OFFSET
1,2
COMMENTS
Numbers k such that k divides A007908(k).
LINKS
Jason Yuen, Table of n, a(n) for n = 1..1195 (terms 1..236 from M. F. Hasler, terms 237..637 from Chai Wah Wu)
EXAMPLE
k = 13 is not a term since 12345678910111213 is not divisible by 13.
MATHEMATICA
b = 10; c = {}; Select[Range[10^5], Divisible[FromDigits[c = Join[c, IntegerDigits[#, b]], b], #] &] (* Robert Price, Mar 11 2020 *)
Select[Range[1200], Divisible[FromDigits[Flatten[IntegerDigits/@Range[#]]], #]&] (* Harvey P. Dale, Dec 31 2020 *)
nxt[{rc_, n_}]:={rc*10^IntegerLength[n+1]+n+1, n+1}; Select[NestList[nxt, {1, 1}, 1200], Mod[#[[1]], #[[2]]]==0&][[;; , 2]] (* Harvey P. Dale, Sep 26 2023 *)
PROG
(PARI) c=0; for(d=1, 1e9, for(n=d, -1+d*=10, (c=c*d+n)%n || print1(n", ")); d--) \\ M. F. Hasler, Sep 11 2011
(Python)
A029455_list, r = [], 0
for n in range(1, 10**4+1):
r = r*10**len(str(n))+n
if not (r % n):
A029455_list.append(n) # Chai Wah Wu, Nov 05 2014
(Python)
def concat_mod(base, k, mod):
total, digits, n1 = 0, 1, 1
while n1 <= k:
n2, p = min(n1*base-1, k), n1*base
# Compute ((p-1)*n1+1)*p**(n2-n1+1)-(n2+1)*p+n2 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)*n1+1)*tmp-(n2+1)*p+n2
tmp = (tmp%((p-1)**2*mod))//(p-1)**2
total = (total*pow(p, n2-n1+1, mod)+tmp)%mod
digits, n1 = digits+1, p
return total
for k in range(1, 10**10+1):
if concat_mod(10, k, k) == 0: print(k) # Jason Yuen, Jan 27 2024
CROSSREFS
KEYWORD
nonn,base
AUTHOR
STATUS
approved