cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A171785 Start with a(1) = 1; then a(n) = smallest number > a(n-1) such that a(n) divides concat(a(1), a(2), ..., a(n)).

Original entry on oeis.org

1, 2, 3, 5, 10, 12, 15, 20, 25, 30, 39, 44, 50, 100, 101, 125, 150, 188, 200, 220, 230, 250, 272, 304, 320, 370, 376, 400, 500, 525, 600, 615, 625, 1000, 1250, 1487, 1500, 1590, 1696, 1750, 2000, 2245, 2500, 3000, 3090, 3125, 3800, 4000, 5000, 5725, 6122, 7025
Offset: 1

Views

Author

David Scambler, Sep 30 2010

Keywords

Comments

Primes appearing so far are 2, 3, 5, 101, 1487.

Examples

			1: 1 divides 1
1,2: 2 divides 12
1,2,3: 3 divides 123
1,2,3,4: 4 does NOT divide 1234, so
1,2,3,5: 5 divides 1235
etc.
		

Crossrefs

See A029455 for numbers that divide the concatenation of all numbers <= n.

Programs

  • Mathematica
    f[s_List] := Block[{k = s[[ -1]] + 1, conc = FromDigits[Flatten@ IntegerDigits@s]}, While[ Mod[conc*10^Floor[ Log[10, k] + 1] + k, k] != 0, k++ ]; Append[s, k]]; Nest[f, {1}, 51] (* Robert G. Wilson v, Oct 14 2010 *)
    nxt[{a_,c_}]:=Module[{k=a+1},While[!Divisible[c*10^IntegerLength[k]+ k, k], k++];{k,c*10^IntegerLength[k]+k}]; Transpose[NestList[nxt,{1,1},60]][[1]] (* Harvey P. Dale, Mar 08 2015 *)

Extensions

More terms from Robert G. Wilson v, Oct 14 2010