OFFSET
1,1
COMMENTS
Original name: 10^n-th difference between cumulative prime and odd sums.
Beginning at 3, compute the sums of the prime and odd sequences at 10^n and take the difference.
LINKS
FORMULA
a(n) = A134181(10^n).
a(n) = A099824(n) + prime(10^n+1) - (10^n*(10^n+2)) - 2. - Chai Wah Wu, Mar 30 2020
a(n) = A071148(10^n) - (10^n+1)^2 + 1, where A071148 are the partial sums of odd primes, and N^2 is the sum of the first N odd integers. - M. F. Hasler, Aug 08 2025
EXAMPLE
a(1) = (3 + 5 + 7 + 11 + 13 + 17 + 19 + 23 + 29 + 31) - (3 + 5 + 7 + 9 + 11 + 13 + 15 + 17 + 19 + 21) = 158 - 120 = 38.
a(2) = 14478 because at 10^2, 100 sums of primes and odds, the prime sum is 24678, the odd sum is 10200 and the difference is 14478.
PROG
(UBASIC)
10 N=1: A=2
20 A=nxtprm(A): B=B+A
30 N=N+2: D=D+N
40 if C=9 then print A; N; B; D; B-D: stop
50 C=C+1: if C<10 then 20
CROSSREFS
KEYWORD
nonn
AUTHOR
Enoch Haga, Oct 13 2007
EXTENSIONS
Edited by M. F. Hasler, Aug 08 2025
STATUS
approved
