OFFSET
1,1
FORMULA
a(n) = (10n-9) isprime (10n-9) + (10n-7) isprime (10n-7) + (10n-3) isprime (10n-3) + (10n-1) isprime (10n-1), where isprime = A010051. - M. F. Hasler, Jun 15 2008
EXAMPLE
a(1) = 3 + 7 = 10.
a(11) = 101 + 103 + 107 + 109 = 420.
a(21) = 0 (there are no primes in {201, 203, 207, 209}).
MATHEMATICA
f[n_]:=Plus@@Select[10n-{9, 7, 3, 1}, PrimeQ]; Table[f[n], {n, 60}] (* Ray Chandler, Feb 20 2009 *)
PROG
(PARI) a(n)=(10*n-9)*isprime(10*n-9) + (10*n-7)*isprime(10*n-7) + (10*n-3)*isprime(10*n-3) + (10*n-1)*isprime(10*n-1) \\ M. F. Hasler, Jun 15 2008
CROSSREFS
KEYWORD
nonn
AUTHOR
Juri-Stepan Gerasimov, Jul 06 2008
EXTENSIONS
Corrected and extended by Ray Chandler, Feb 20 2009
STATUS
approved