login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A096936 Half of number of integer solutions to the equation x^2 + 3y^2 = n. 9
1, 0, 1, 3, 0, 0, 2, 0, 1, 0, 0, 3, 2, 0, 0, 3, 0, 0, 2, 0, 2, 0, 0, 0, 1, 0, 1, 6, 0, 0, 2, 0, 0, 0, 0, 3, 2, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 3, 3, 0, 0, 6, 0, 0, 0, 0, 2, 0, 0, 0, 2, 0, 2, 3, 0, 0, 2, 0, 0, 0, 0, 0, 2, 0, 1, 6, 0, 0, 2, 0, 1, 0, 0, 6, 0, 0, 0, 0, 0, 0, 4, 0, 2, 0, 0, 0, 2, 0, 0, 3, 0, 0, 2, 0, 0 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,4

REFERENCES

N. J. Fine, Basic Hypergeometric Series and Applications, Amer. Math. Soc., 1988; p. 78, Eq. (32.25).

LINKS

Antti Karttunen, Table of n, a(n) for n = 1..65537

M. D. Hirschhorn, The number of representations of a number by various forms, Discrete Mathematics 298 (2005), 205-211.

José Manuel Rodríguez Caballero, Divisors on overlapped intervals and multiplicative functions, arXiv:1709.09621 [math.NT], 2017.

FORMULA

a(n) = A033716(n) / 2.

Multiplicative with a(2^e) = 3*(1+(-1)^e)/2, a(3^e) = 1, a(p^e) = (1+(-1)^e)/2 if p==2 (mod 3) and a(p^e) = 1+e if p==1 (mod 3). - Corrected by Antti Karttunen, Nov 20 2017

G.f.: ((Sum_{k in Z} x^(k^2)) * (Sum_{k in Z} x^(3*k^2)) - 1)/2.

EXAMPLE

G.f. = x + x^3 + 3*x^4 + 2*x^7 + x^9 + 3*x^12 + 2*x^13 + 3*x^16 + 2*x^19 + ...

MAPLE

sigmamr := proc(n, m, r) local a, d ; a := 0 ; for d in numtheory[divisors](n) do if modp(d, m) = r then  a := a+1 ; end if; end do: a; end proc:

A002324 := proc(n) sigmamr(n, 3, 1)-sigmamr(n, 3, 2) ; end proc:

A096936 := proc(n) A002324(n) +2*(sigmamr(n, 12, 4)-sigmamr(n, 12, 8) ); end proc:

seq(A096936(n), n=1..90) ; # R. J. Mathar, Mar 23 2011

MATHEMATICA

a[ n_] := If[ n < 1, 0, Times @@ (Which[ # == 1 || # == 3, 1, # == 2, 3 (1 + (-1)^#2)/2, Mod[#, 3] == 1, #2 + 1, True, (1 + (-1)^#2)/2] & @@@ FactorInteger[n])]; (* Michael Somos, Nov 20 2017 *)

PROG

(PARI) {a(n) = if( n<1, 0, 1/2 * polcoeff( sum(k=1, sqrtint(n), 2*x^k^2, 1 + x*O(x^n)) * sum(k=1, sqrtint(n\3), 2*x^(3*k^2), 1 + x*O(x^n)), n))};

(PARI) {a(n) = if( n<1, 0, qfrep([1, 0; 0, 3], n)[n])}; /* Michael Somos, Jun 05 2005 */

(PARI) {a(n) = my(A, p, e); if( n<1, 0, A = factor(n); prod( k=1, matsize(A)[1], [p, e] = A[k, ]; if( p==3, 1, p==2, 3 * (1 + (-1)^e) / 2, p%3==2, (1 + (-1)^e) / 2, e+1)))}; /* Michael Somos, Nov 20 2017 */

(Scheme) (definec (A096936 n) (if (= 1 n) n (let ((p (A020639 n)) (e (A067029 n)) (rest (A096936 (A028234 n)))) (cond ((= 2 p) (* (if (odd? e) 0 3) rest)) ((= 3 p) rest) ((= 1 (modulo p 3)) (* (+ 1 e) rest)) (else (* (if (odd? e) 0 1) rest)))))) ;; With the memoization-macro definec, after the given multiplicative formula. - Antti Karttunen, Nov 20 2017

CROSSREFS

Cf. A033716, A115979.

Sequence in context: A212221 A343088 A193291 * A115979 A067168 A099475

Adjacent sequences:  A096933 A096934 A096935 * A096937 A096938 A096939

KEYWORD

nonn,mult

AUTHOR

Michael Somos, Jul 15 2004

STATUS

approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified October 23 14:24 EDT 2021. Contains 348214 sequences. (Running on oeis4.)