OFFSET
0,11
LINKS
Antti Karttunen, Table of n, a(n) for n = 0..11050
FORMULA
a(2n) = A008442(n), a(2n+1) = 0.
EXAMPLE
a(2) = 1 as 2 = 1 + 1.
a(10) = 2 as 10 = 1 + 9 = 9 + 1.
a(50) = 3 as 50 = 1 + 49 = 49 + 1 = 25 + 25.
PROG
(Scheme) (define (A290081 n) (cond ((< n 2) 0) ((odd? n) 0) (else (let loop ((k (- (A000196 n) (modulo (+ 1 (A000196 n)) 2))) (s 0)) (if (< k 1) s (loop (- k 2) (+ s (A010052 (- n (* k k))))))))))
(PARI) upto(n) = {my(m, v, res = vector(n)); m = (sqrtint(n)+1)\2; v = vector(m, i, (2*i-1)^2); forvec(x = vector(2, i, [1, #v]), s = v[x[1]] + v[x[2]]; if(s <= n, res[s]+=(1+(x[1]!=x[2]))), 1); concat(0, res)} \\ David A. Corneth, Jul 24 2017
(PARI)
A008442(n) = if( n<1 || n%4!=1, 0, sumdiv(n, d, (d%4==1) - (d%4==3))); \\ This function from Michael Somos, Apr 24 2004
(Python)
from sympy import divisors
def A290081(n): return 0 if n&1 else 0 if (m:=n>>1)&3!=1 else sum(((a:=d&3)==1)-(a==3) for d in divisors(m, generator=True)) # Chai Wah Wu, May 17 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Jul 24 2017
STATUS
approved