Thursday, May 9, 2024

A370831 Contribution to the OEIS

 

A370831Alternating sum of composites.0
4, 2, 6, 3, 7, 5, 9, 6, 10, 8, 12, 9, 13, 11, 14, 12, 15, 13, 17, 15, 18, 16, 19, 17, 21, 18, 22, 20, 24, 21, 25, 23, 26, 24, 27, 25, 29, 26, 30, 27, 31, 29, 33, 30, 34, 31, 35, 33, 36, 34, 38, 36, 39, 37, 40, 38, 42, 39, 43, 41, 44, 42, 45, 43, 47, 44, 48, 45, 49, 46 (listgraphrefslistenhistoryedittextinternal format)
OFFSET
1,1
COMMENTS
Unlike equivalent sequence for primes, A008347, there are repeated terms.
LINKS
FORMULA
a(n) = A002808(n) - a(n-1), for n>1.
EXAMPLE
a(4) = 9 - 8 + 6 - 4 = 3.
MATHEMATICA
Join[{4}, a[1]=4; a[n_]:=ResourceFunction["Composite"][n] - a[n-1]; Table[a[n], {n, 2, 70}]] (* or with signs *) R=70; a[1]=4; a[n_]:=a[n-1]-ResourceFunction["Composite"][n] *(-1)^n; Table[a[n], {n, 70}]
CROSSREFS
Sequence in context: A246879 A302794 A247361 * A297307 A163238 A097362
KEYWORD
nonn
AUTHOR
James C. McMahon, Mar 02 2024
STATUS
approved

No comments:

Post a Comment

1679 - One important message sent from Earth 31 years ago

In 1974 an interstellar radio transmission was broadcast to the  globular cluster   Messier 13   from the Arecibo radio telescope in Puerto ...

Popular in last 30 days