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!)
A253387 A "mod sequence" where a(n) is the eventual constant value attained by the sequence defined as b(1) = n, b(m) = (sum_{k=1..m-1} b(k)) mod m, with a(n) = -1 in case a constant run is not found. 1
97, 97, 1, 1, 2, 2, 2, 2, 316, 316, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 12, 12, 4, 4, 4, 4, 12, 12, 11, 11, 11, 11, 316, 316, 11, 11, 316, 316, 316, 316, 6, 6, 316, 316, 316, 316, 316, 316, 316, 316, 97, 97, 316, 316, 316, 316, 13, 13, 316, 316, 13 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
LINKS
Jean-François Alcover, Table of n, a(n) for n = 1..1000
EXAMPLE
a(5) = 2, because the b sequence is 5, 1, 0, 2, 3, 5, 2, 2, 2, 2, 2, ...
MATHEMATICA
Clear[a]; constantLength = 10; kMax = 2000; a[n_] := a[n] = Module[{k}, Clear[b]; For[ b[1] = n; b[m_] := b[m] = Mod[Sum[b[j], {j, 1, m-1}], m]; k = constantLength, k <= kMax, k++, If[Equal @@ Table[b[k-j], {j, 0, constantLength-1}], Print["a(", n, ") = ", b[k], ", k = ", k - constantLength+1]; Return[b[k]]]]; Print["a(", n, ") = ", -1, ", k = ", k - constantLength+1, " constant run not found"]; Return[-1]]; Table[a[n], {n, 1, 100}]
CROSSREFS
Sequence in context: A126146 A112667 A106419 * A074482 A130765 A111326
KEYWORD
sign
AUTHOR
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 16:38 EDT 2024. Contains 371794 sequences. (Running on oeis4.)