%I #15 Mar 14 2017 00:26:40
%S 1,2,4,7,0,2,5,8,12,16,20,2,6,10,16,21,27,34,3,9,15,21,27,37,45,1,9,
%T 17,25,33,45,54,63,7,18,27,37,49,60,72,3,14,26,38,50,62,74,94,8,19,35,
%U 49,61,77,93,107,11,25,41,57,73,89,113,2,15,35,52,67,88,110,129,5,25,44,64,83,105,125,146,9,31,52,73,97
%N Remainder when sum of first n terms of the Hofstadter Q-sequence is divided by 2*n.
%C Sequence represents c(n, 2) where c(n, i) = (Sum_{k = 1..n} A005185(k)) mod (n*i). See also A283025 and corresponding illustration in Links section.
%H Altug Alkan, <a href="/A283509/b283509.txt">Table of n, a(n) for n = 1..10000</a>
%H Altug Alkan, <a href="/A283509/a283509.png">Illustration Of Residue Classes Modulo 8</a>
%e a(4) = 7 since Sum_{k = 1..4} A005185(k) = 1 + 1 + 2 + 3 = 7 and remainder when 7 is divided by 8 is 7.
%p A005185:= proc(n) option remember; procname(n-procname(n-1)) +procname(n-procname(n-2)) end proc:
%p A005185(1):= 1: A005185(2):= 1:
%p L:= ListTools[PartialSums](map(A005185, [$1..1000])):
%p seq(L[i] mod (2*i), i=1..1000); # after _Robert Israel_ at A283025
%t a[1] = a[2] = 1; a[n_] := a[n] = a[n - a[n - 1]] + a[n - a[n - 2]]; Table[Mod[Total@ Array[a, n], 2 n], {n, 84}] (* _Michael De Vlieger_, Mar 13 2017 *)
%o (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]) % (2*n))
%Y Cf. A005185, A076268, A283025.
%K nonn
%O 1,2
%A _Altug Alkan_, Mar 09 2017
|