OFFSET
1,4
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..10000
FORMULA
a(n) = A007908(n-1) mod n for n>1. - Michel Marcus, Nov 21 2022
EXAMPLE
a(5) = 15 hence a(6) = least integer multiple of 15/6 = 5.
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 *)
PROG
(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
(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
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Amarnath Murthy, Apr 29 2004
EXTENSIONS
More terms from Sam Handler (sam_5_5_5_0(AT)yahoo.com), Nov 12 2004
STATUS
approved