|
|
A163636
|
|
The sum of all odd numbers from 2n-1 up to the n-th odd nonprime.
|
|
1
|
|
|
1, 24, 60, 112, 153, 171, 253, 275, 336, 448, 525, 555, 640, 672, 828, 864, 969, 1155, 1197, 1320, 1449, 1495, 1632, 1680, 1728, 1875, 2133, 2407, 2580, 2640, 2700, 2760, 2820, 2880, 3069, 3264, 3328, 3672, 3740, 3808, 3876, 4248, 4320, 4551, 4625, 4864
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
LINKS
|
|
|
FORMULA
|
|
|
EXAMPLE
|
a(1)=1. a(2)=3+5+7+9=24. a(3)=5+7+9+11+13+15=60.
|
|
MAPLE
|
A014076 := proc(n) option remember; local a; if n = 1 then 1; else for a from procname(n-1)+2 by 2 do if not isprime(a) then RETURN(a) ; fi; od: fi; end:
|
|
MATHEMATICA
|
Module[{nn=201, onp}, onp=Select[Range[1, nn, 2], !PrimeQ[#]&]; Table[Total[ Range[ 2n-1, onp[[n]], 2]], {n, Length[onp]}]] (* Harvey P. Dale, Jul 03 2020 *)
|
|
PROG
|
(Python)
from sympy import primepi
if n == 1: return 1
m, k, n2 = n-1, primepi(n) + n - 1 + (n>>1), (n<<1)-1
while m != k:
m, k = k, primepi(k) + n - 1 + (k>>1)
return (lambda x: (x+n2)*(x-n2+2)>>2)(m) # Chai Wah Wu, Jul 31 2024
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,easy
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|