HP Forums
(35S) Connell’s sequence ( OEIS A001614) formula - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Software Libraries (/forum-10.html)
+--- Forum: General Software Library (/forum-13.html)
+--- Thread: (35S) Connell’s sequence ( OEIS A001614) formula (/thread-2569.html)



(35S) Connell’s sequence ( OEIS A001614) formula - Gerald H - 12-06-2014 10:27 AM

Connell’s sequence ( OEIS A001614) starting at index N=1:

1, 2, 4, 5, 7, 9, 10, 12, 14, 16, 17, 19, 21, 23, 25, 26.....

For non-negative integer N input solve this equation

C = 2 * N – (IP( SQRT( 2 * N ) + 0.5 ) ► U ) + 0 * ( N – ( U * ( ( 6 * N + 1 ) – SQ( U ) ) / 6 ► V ) + SQ( N ) ► S ) * ( 2 * N + U ► D ) * ( N + V + SQ( N ) ► E )

for C. You will be prompted for values other than N, ignore these prompts with R/S.

eg

For N=999,528

The calculator returns

C=1,997,642.

In variable S you find the sum of the first 999,258 terms

S=998,115,080,475

In variable D the Nth number NOT in the Connell sequence

D=2,000,470

& in variable E the sum of the first N numbers NOT in the Connell sequence

E=999,999,364,149