A094151 Remainder when concatenation 1,2,3,...up to (n-1) is divided by n.
0, 1, 0, 3, 4, 3, 4, 7, 0, 9, 4, 3, 12, 9, 9, 7, 1, 9, 7, 19, 12, 15, 18, 15, 24, 9, 0, 11, 27, 9, 7, 7, 15, 9, 9, 27, 29, 21, 21, 39, 22, 33, 5, 15, 9, 39, 45, 39, 39, 49, 27, 51, 33, 27, 4, 23, 15, 49, 49, 39, 32, 13, 54, 7, 9, 15, 41, 59, 0, 39, 47, 63, 41, 17, 24, 23, 37, 21, 75, 39
Offset: 1
Examples
a(5) = 15 hence a(6) = least integer multiple of 15/6 = 5.
Links
- Michael S. Branicky, Table of n, a(n) for n = 1..10000
Programs
-
Mathematica
Table[st = ""; For[i = 0, i <= n - 1, i++, st = st <> ToString[i]]; Mod[ ToExpression[st], n], {n, 1, 100}] (* Sam Handler (sam_5_5_5_0(AT)yahoo.com), Nov 12 2004 *) Table[Mod[FromDigits[Flatten[IntegerDigits/@Range[n-1]]],n],{n,100}] (* Harvey P. Dale, May 21 2024 *)
-
PARI
a(n)=if(n<=9, return(1719%n)); my(m=Mod(123456789,n)); for(d=2,#Str(n-1), my(D=10^d); for(k=D/10,min(D,n)-1, m=D*m+k)); lift(m) \\ Charles R Greathouse IV, Nov 21 2022
-
Python
from itertools import count, islice def agen(): s = "0" for n in count(1): yield int(s)%n; s += str(n) print(list(islice(agen(), 80))) # Michael S. Branicky, Nov 21 2022
Formula
a(n) = A007908(n-1) mod n for n>1. - Michel Marcus, Nov 21 2022
Extensions
More terms from Sam Handler (sam_5_5_5_0(AT)yahoo.com), Nov 12 2004
Comments