OFFSET
0,2
EXAMPLE
The 7th prime, 17, is congruent to 3 (mod 7). So a(7) = a(6) + a(3) = 20 + 8 = 28.
MAPLE
a:=proc(n) if n=0 then 1 else a(n-1)+a(ithprime(n) mod n) fi end: seq(a(n), n=0..55); # Emeric Deutsch, Mar 23 2007
MATHEMATICA
f[l_List] := Block[{n = Length[l]}, Append[l, l[[Mod[Prime[n], n] + 1]] + l[[ -1]]]]; Nest[f, {1}, 50] (* Ray Chandler, Mar 23 2007 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Leroy Quet, Mar 21 2007
EXTENSIONS
More terms from Emeric Deutsch and Ray Chandler, Mar 23 2007
STATUS
approved