A282891 Remainder when sum of first n terms of A004001 is divided by n.
0, 0, 1, 2, 4, 1, 3, 5, 8, 2, 6, 10, 2, 6, 10, 14, 2, 7, 13, 0, 6, 13, 21, 5, 13, 21, 2, 10, 18, 26, 3, 10, 18, 27, 2, 12, 23, 34, 7, 19, 32, 3, 16, 30, 44, 13, 27, 41, 7, 22, 37, 1, 16, 31, 47, 7, 22, 37, 53, 9, 24, 39, 54, 5, 20, 36, 53, 3, 21, 40, 59, 7, 27, 48, 70, 16, 38, 61, 6, 29, 53, 78, 20, 45, 70, 9, 34, 60, 87, 24
Offset: 1
Examples
a(5) = 4 since Sum_{k=1..5} A004001(k) = 1 + 1 + 2 + 2 + 3 = 9 and remainder when 9 is divided by 5 is 4.
Links
- Altug Alkan, Table of n, a(n) for n = 1..10000
- Altug Alkan, Alternative Scatterplot of A282891
- Altug Alkan, Illustration Of Residue Classes Modulo 4
Programs
-
Maple
A004001:= proc(n) option remember; procname(procname(n-1)) +procname(n-procname(n-1)) end proc: A004001(1):= 1: A004001(2):= 1: L:= ListTools[PartialSums](map(A004001, [$1..1000])): seq(L[i] mod i, i=1..1000); # Robert Israel, Feb 24 2017
-
Mathematica
a[1] = 1; a[2] = 1; a[n_] := a[n] = a[a[n - 1]] + a[n - a[n - 1]]; MapIndexed[Last@ QuotientRemainder[#1, First@ #2] &, Accumulate@ Table[a@ n, {n, 90}]] (* Michael De Vlieger, Feb 24 2017, after Robert G. Wilson v at A004001 *)
-
PARI
first(n)=my(v=vector(n),s); v[1]=v[2]=1; for(k=3, n, v[k]=v[v[k-1]]+v[k-v[k-1]]); for(k=1,n, s+=v[k]; v[k]=s%k); v \\ Charles R Greathouse IV, Feb 26 2017
Formula
a(n) = (Sum_{k=1..n} A004001(k)) mod n.
Comments