login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A290081 a(n) = number of ways of writing n as the sum of two odd positive squares. 5
0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,11
LINKS
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
A290081(n) = if(n%2, 0, A008442(n/2));
(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
Bisections: A000004, A008442.
Sequence in context: A318655 A056626 A366123 * A347706 A348381 A010103
KEYWORD
nonn
AUTHOR
Antti Karttunen, Jul 24 2017
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 25 05:49 EDT 2024. Contains 371964 sequences. (Running on oeis4.)