login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A284173
a(n) = (Sum_{k=1..n} q(k+1-q(k))) mod n where q(k) = A005185(k).
3
0, 0, 0, 0, 1, 2, 3, 5, 7, 9, 1, 2, 4, 7, 9, 12, 15, 0, 3, 6, 9, 12, 17, 20, 0, 4, 8, 12, 16, 22, 26, 31, 4, 9, 14, 20, 26, 31, 37, 3, 8, 14, 20, 26, 32, 38, 1, 4, 11, 18, 23, 30, 39, 46, 53, 6, 12, 20, 28, 36, 44, 56, 1, 9, 21, 28, 36, 46, 57, 68, 9, 20, 30, 39, 48, 60, 69, 2, 12
OFFSET
1,6
COMMENTS
Sequence represents d(n, 1, 1) where d(n, i, j) = (Sum_{k=1..n} q(k+j-q(k))) mod (n*i) where q(k) = A005185(k).
FORMULA
a(n) = A280706(n) mod n. - Antti Karttunen, Mar 22 2017
MAPLE
N:= 1000: # to get a(1) to a(N)
B[1]:= 1:
B[2]:= 1:
for n from 3 to N do
B[n]:= B[n-B[n-1]] + B[n-B[n-2]];
od:
seq(add(B[k+1-B[k]], k=1..n) mod n, n=1..N); # Robert Israel, Mar 22 2017
MATHEMATICA
q[n_]:=If[n<3, 1, q[n - q[n - 1]] + q[n - q[n - 2]]]; a[n_]:=Mod[Sum[q[k + 1 - q[k]], {k, n}], n]; Table[a[n], {n, 100}] (* Indranil Ghosh, Mar 21 2017 *)
PROG
(PARI) a=vector(1000); a[1]=a[2]=1; for(n=3, #a, a[n]=a[n-a[n-1]]+a[n-a[n-2]]); vector(#a, n, sum(k=1, n, a[k+1-a[k]]) % n)
(Scheme) (define (A284173 n) (modulo (A280706 n) n)) ;; Other code as in A280706, A283467 and A005185 - Antti Karttunen, Mar 22 2017
CROSSREFS
KEYWORD
nonn
AUTHOR
Altug Alkan, Mar 21 2017
STATUS
approved