[go: up one dir, main page]

login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Revision History for A361982 (Bold, blue-underlined text is an addition; faded, red-underlined text is a deletion.)

Showing entries 1-10 | older changes
a(n) = 1 + Sum_{k=2..n} (-1)^k * k * a(floor(n/k)).
(history; published version)
#18 by Alois P. Heinz at Sun Apr 02 13:22:06 EDT 2023
STATUS

proposed

approved

#17 by Chai Wah Wu at Sun Apr 02 13:14:06 EDT 2023
STATUS

editing

proposed

#16 by Chai Wah Wu at Sun Apr 02 13:14:04 EDT 2023
PROG

return c+((-(n<<1)-1 if n&1 else (n<<1)+1)+(-(j<<1)+1 if j&1 else (j<<1)-1)>>2) # Chai Wah Wu, Apr 02 2023

#15 by Chai Wah Wu at Sun Apr 02 13:13:55 EDT 2023
PROG

(Python)

from functools import lru_cache

@lru_cache(maxsize=None)

def A361982(n):

if n <= 1:

return 1

c, j = 1, 2

k1 = n//j

while k1 > 1:

j2 = n//k1 + 1

c += (((j2<<1)-1 if j2&1 else -(j2<<1)+1)+(-(j<<1)+1 if j&1 else (j<<1)-1)>>2)*A361982(k1)

j, k1 = j2, n//j2

return c+((-(n<<1)-1 if n&1 else (n<<1)+1)+(-(j<<1)+1 if j&1 else (j<<1)-1)>>2) # Chai Wah Wu, Apr 02 2023

STATUS

approved

editing

#14 by Michael De Vlieger at Sun Apr 02 09:47:55 EDT 2023
STATUS

proposed

approved

#13 by Seiichi Manyama at Sun Apr 02 08:54:27 EDT 2023
STATUS

editing

proposed

#12 by Seiichi Manyama at Sun Apr 02 08:46:03 EDT 2023
CROSSREFS
#11 by Seiichi Manyama at Sun Apr 02 08:44:39 EDT 2023
KEYWORD

sign,new,look

#10 by Seiichi Manyama at Sun Apr 02 08:44:15 EDT 2023
LINKS

Seiichi Manyama, <a href="/A361982/b361982.txt">Table of n, a(n) for n = 1..8191</a>

STATUS

approved

editing

#9 by N. J. A. Sloane at Sun Apr 02 08:32:33 EDT 2023
STATUS

proposed

approved