# Greetings from The On-Line Encyclopedia of Integer Sequences! http://oeis.org/ Search: id:a072004 Showing 1-1 of 1 %I A072004 #9 Jan 14 2023 08:45:57 %S A072004 0,1,3,3,10,0,3,1,15,19,10,28,12,1,32,25,0,42,42,45,4,23,77,50,30,45, %T A072004 86,43,64,100,23,105,89,41,87,54,133,2,59,47,147,64,174,102,65,104,7, %U A072004 127,107,28,210,194,106,60,159,95,119,116,104,230,224,110,183,212,287 %N A072004 Remainder when sum of squares of first n primes is divided by n-th prime. %F A072004 a(n) = s(n) - prime(n)*q(n), where s(n) = sum of squares of first n primes, prime(n) is n-th prime and q(n) is floor(s(n)/prime(n)). %e A072004 a[3] = 3 because s[3] = 2*2 + 3*3 + 5*5 = 38, p[3]=5 and q[3]= floor(38/5)=7, so a[3] = 38-5*7 = 3. %t A072004 Mod[#[[1]],#[[2]]]&/@With[{nn=70},Thread[{Accumulate[Prime[ Range[ nn]]^2], Prime[Range[nn]]}]] (* _Harvey P. Dale_, Aug 09 2015 *) %o A072004 (PARI) a(n) = sum(k=1, n, prime(k)^2) % prime(n); \\ _Michel Marcus_, Jan 14 2023 %Y A072004 Cf. A024450 (s(n)). %K A072004 easy,nonn %O A072004 1,3 %A A072004 _Randy L. Ekl_, Jun 18 2002 # Content is available under The OEIS End-User License Agreement: http://oeis.org/LICENSE