cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-4 of 4 results.

A000089 Number of solutions to x^2 + 1 == 0 (mod n).

Original entry on oeis.org

1, 1, 0, 0, 2, 0, 0, 0, 0, 2, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 2, 0, 0, 0, 0, 2, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 2, 0, 0, 0, 0, 2, 0, 0, 2, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 4, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0
Offset: 1

Views

Author

Keywords

Comments

Number of elliptic points of order 2 for GAMMA_0(n).
The Dirichlet inverse, 1, -1, 0, 1, -2, 0, 0, -1, 0, 2, 0, 0, -2, 0,.. seems to equal A091400, apart from signs. - R. J. Mathar, Jul 15 2010
Shadow transform of A002522. - Michel Marcus, Jun 06 2013
a(n) != 0 iff n in A008784. - Joerg Arndt, Mar 26 2014
For n > 1, number of positive solutions to n = a^2 + b^2 such that gcd(a, b) = 1. - Haehun Yang, Mar 20 2022

Examples

			G.f. = x + x^2 + 2*x^5 + 2*x^10 + 2*x^13 + 2*x^17 + 2*x^25 + 2*x^26 + 2*x^29 + ...
		

References

  • Michael Baake, "Solution of the coincidence problem in dimensions d <= 4", in R. V. Moody, ed., Mathematics of Long-Range Aperiodic Order, Kluwer, 1997, pp. 9-44.
  • Goro Shimura, Introduction to the Arithmetic Theory of Automorphic Functions, Princeton, 1971, see p. 25, Eq. (2).

Crossrefs

Cf. A031358, A027748, A124010, A000095, A006278 (positions of records), A002654, A093582.

Programs

  • Haskell
    a000089 n = product $ zipWith f (a027748_row n) (a124010_row n) where
       f 2 e = if e == 1 then 1 else 0
       f p _ = if p `mod` 4 == 1 then 2 else 0
    -- Reinhard Zumkeller, Mar 24 2012
    
  • Maple
    with(numtheory); A000089 := proc (n) local i, s; if modp(n,4) = 0 then RETURN(0) fi; s := 1; for i in divisors(n) do if isprime(i) and i > 2 then s := s*(1+eval(legendre(-1,i))) fi od; s end: # Gene Ward Smith, May 22 2006
  • Mathematica
    Array[ Function[ n, If[ EvenQ[ n ] || Mod[ n, 3 ]==2, 0, Count[ Array[ Mod[ #^2+1, n ]&, n, 0 ], 0 ] ] ], 84 ]
    a[ n_] := If[ n < 1, 0, Length @ Select[ (#^2 + 1)/n & /@ Range[n], IntegerQ]]; (* Michael Somos, Aug 15 2015 *)
    a[n_] := a[n] = Product[{p, e} = pe; Which[p<3 && e==1, 1, p==2 && e>1, 0, Mod[p, 4]==1, 2, Mod[p, 4]==3, 0, True, a[p^e]], {pe, FactorInteger[n]}]; Array[a, 105] (* Jean-François Alcover, Oct 18 2018, after David W. Wilson *)
  • PARI
    {a(n) = if( n<1, 0, sum( x=0, n-1, (x^2 + 1)%n==0))}; \\ Michael Somos, Mar 24 2012
    
  • PARI
    a(n)=my(o=valuation(n,2),f);if(o>1,0,n>>=o;f=factor(n)[,1]; prod(i=1,#f,kronecker(-1,f[i])+1)) \\ Charles R Greathouse IV, Jul 08 2013
    
  • Python
    from math import prod
    from sympy import primefactors
    def A000089(n): return prod(1 if p==2 else 2 if p&3==1 else 0 for p in primefactors(n)) if n&3 else 0 # Chai Wah Wu, Oct 13 2024

Formula

a(n) = 0 if 4|n, else a(n) = Product_{ p | N } (1 + Legendre(-1, p) ), where we use the definition that Legendre(-1, 2) = 0, Legendre(-1, p) = 1 if p == 1 mod 4, = -1 if p == 3 mod 4. This is Shimura's definition, which is different from Maple's.
Dirichlet g.f.: (1+2^(-s))*Product (1+p^(-s))/(1-p^(-s)) (p=1 mod 4).
Multiplicative with a(p^e) = 1 if p = 2 and e = 1; 0 if p = 2 and e > 1; 2 if p == 1 (mod 4); 0 if p == 3 (mod 4). - David W. Wilson, Aug 01 2001
a(3*n) = a(4*n) = a(4*n + 3) = 0. a(4*n + 1) = A031358(n). - Michael Somos, Mar 24 2012
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = 3/(2*Pi) = 0.477464... (A093582). - Amiram Eldar, Oct 11 2022

A091379 a(n) = Product_{ p | n } (1 + Legendre(-1,p) ).

Original entry on oeis.org

1, 2, 0, 2, 2, 0, 0, 2, 0, 4, 0, 0, 2, 0, 0, 2, 2, 0, 0, 4, 0, 0, 0, 0, 2, 4, 0, 0, 2, 0, 0, 2, 0, 4, 0, 0, 2, 0, 0, 4, 2, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 4, 2, 0, 0, 0, 0, 4, 0, 0, 2, 0, 0, 2, 4, 0, 0, 4, 0, 0, 0, 0, 2, 4, 0, 0, 0, 0, 0, 4, 0, 4, 0, 0, 4, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 4, 2, 0, 0, 4, 0
Offset: 1

Views

Author

N. J. A. Sloane, Mar 02 2004

Keywords

References

  • Goro Shimura, Introduction to the Arithmetic Theory of Automorphic Functions, Princeton, 1971, see p. 25, Eq. (2) (but without the restriction that a(4k) = 0 and with a different definition of Legendre(-1,2)).

Crossrefs

Programs

  • Maple
    with(numtheory); A091379 := proc(n) local i,t1,t2; t1 := ifactors(n)[2]; t2 := mul((1+legendre(-1,t1[i][1])),i=1..nops(t1)); end;
  • Mathematica
    a[n_] := Module[{t1, t2}, t1 = FactorInteger[n]; t2 = Product[(1 + KroneckerSymbol[-1, t1[[i, 1]]]), {i, 1, Length[t1]}]]; a[1] = 1;
    Array[a, 105] (* Jean-François Alcover, Feb 08 2022, from Maple code *)
  • PARI
    vecproduct(v) = { my(m=1); for(i=1,#v,m *= v[i]); m; };
    A091379(n) = vecproduct(apply(p -> (1 + kronecker(-1,p)), factorint(n)[, 1])); \\ Antti Karttunen, Nov 18 2017

Formula

Here we use the definition that Legendre(-1, 2) = 1, Legendre(-1, p) = 1 if p == 1 mod 4, = -1 if p == 3 mod 4.
From Amiram Eldar, Oct 11 2022: (Start)
Multiplicative with a(p^e) = 0 if p == 3 (mod 4) and 2 otherwise.
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = 3/Pi = 0.954929... (A089491). (End)

A129448 Expansion of q * psi(-q) * chi(q^3)^2 * psi(-q^9) in powers of q where psi(), chi() are Ramanujan theta functions.

Original entry on oeis.org

1, -1, 0, 1, -2, 0, 0, -1, 0, 2, 0, 0, 2, 0, 0, 1, -2, 0, 0, -2, 0, 0, 0, 0, 3, -2, 0, 0, -2, 0, 0, -1, 0, 2, 0, 0, 2, 0, 0, 2, -2, 0, 0, 0, 0, 0, 0, 0, 1, -3, 0, 2, -2, 0, 0, 0, 0, 2, 0, 0, 2, 0, 0, 1, -4, 0, 0, -2, 0, 0, 0, 0, 2, -2, 0, 0, 0, 0, 0, -2, 0, 2, 0, 0, 4, 0, 0, 0, -2, 0, 0, 0, 0, 0, 0, 0, 2, -1, 0, 3, -2, 0, 0, -2, 0
Offset: 1

Views

Author

Michael Somos, Apr 16 2007

Keywords

Comments

Ramanujan theta functions: f(q) (see A121373), phi(q) (A000122), psi(q) (A010054), chi(q) (A000700).
Number 50 of the 74 eta-quotients listed in Table I of Martin (1996).

Examples

			G.f. = q - q^2 + q^4 - 2*q^5 - q^8 + 2*q^10 + 2*q^13 + q^16 - 2*q^17 - 2*q^20 + ...
		

Crossrefs

Programs

  • Magma
    A := Basis( ModularForms( Gamma1(36), 1), 82); A[2] - A[3] + A[5] - 2*A[6] - A[9] + 2*A[11] + 2*A[14] + A[17] - 2*A[18]; /* Michael Somos, Jul 09 2015 */
  • Mathematica
    a[ n_] := If[ n < 1, 0, Sum[ KroneckerSymbol[ 12, d] KroneckerSymbol[ -3, n/d], {d, Divisors[ n]}]]; (* Michael Somos, Jul 09 2015 *)
    a[ n_] := SeriesCoefficient[ q QPochhammer[ -q^3, q^6]^2 EllipticTheta[ 2, Pi/4, q^(1/2)] EllipticTheta[ 2, Pi/4, q^(9/2)] / (2 q^(5/4)), {q, 0, n}]; (* Michael Somos, Jul 09 2015 *)
  • PARI
    {a(n) = if( n<1, 0, sumdiv(n, d, kronecker( 12, d) * kronecker( -3, n/d)))};
    
  • 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, 0, p==2, (-1)^e, p%12>6, !(e%2), (-1)^(e * (p%12==5)) * (e+1))))};
    
  • PARI
    {a(n) = my(A); if( n<1, 0, n--; A = x * O(x^n); polcoeff( eta(x + A) * eta(x^4 + A) * eta(x^6 + A)^4 * eta(x^9 + A) * eta(x^36 + A) / (eta(x^2 + A) * eta(x^3 + A)^2 * eta(x^12 + A)^2 * eta(x^18 + A)), n))};
    

Formula

Expansion of eta(q) * eta(q^4) * eta(q^6)^4 * eta(q^9) * eta(q^36) / (eta(q^2) * eta(q^3)^2 * eta(q^12)^2 * eta(q^18)) in powers of q.
Euler transform of period 36 sequence [ -1, 0, 1, -1, -1, -2, -1, -1, 0, 0, -1, -1, -1, 0, 1, -1, -1, -2, -1, -1, 1, 0, -1, -1, -1, 0, 0, -1, -1, -2, -1, -1, 1, 0, -1, -2, ...].
a(n) is multiplicative with a(2^e) = (-1)^e, a(3^e) = 0^e, a(p^e) = (1 + (-1)^e) / 2 if p == 7, 11 (mod 12), a(p^e) = e+1 if p == 1 (mod 12), a(p^e) = (-1)^e * (e+1) if p == 5 (mod 12).
G.f. is a period 1 Fourier series which satisfies f(-1 / (36 t)) = 6 (t/i) f(t) where q = exp(2 Pi i t).
G.f.: Sum_{k>0} Kronecker(12, k) * x^k/ (1 + x^k + x^(2*k)).
|a(n)| = A091400(n). a(3*n) = a(4*n + 3) = 0. a(2*n) = -a(n). a(3*n + 1) = A122865(n). a(3*n + 2) = - A122856(n). a(4*n + 1) = A121363(n). a(12*n + 1) = A002175(n). a(12*n + 5) = -2 * A121444(n).

A281453 Expansion of f(x, x) * f(x^7, x^11) in powers of x where f(, ) is Ramanujan's general theta function.

Original entry on oeis.org

1, 2, 0, 0, 2, 0, 0, 1, 2, 2, 0, 3, 2, 0, 0, 2, 4, 0, 0, 0, 2, 0, 0, 2, 0, 2, 0, 2, 0, 0, 0, 0, 3, 2, 0, 0, 6, 0, 0, 0, 1, 4, 0, 2, 2, 0, 0, 2, 2, 4, 0, 0, 0, 0, 0, 0, 4, 2, 0, 0, 2, 0, 0, 0, 2, 2, 0, 0, 2, 0, 0, 2, 0, 0, 0, 3, 4, 0, 0, 2, 0, 4, 0, 0, 2, 0, 0
Offset: 0

Views

Author

Michael Somos, Jan 26 2017

Keywords

Examples

			G.f. = 1 + 2*x + 2*x^4 + x^7 + 2*x^8 + 2*x^9 + 3*x^11 + 2*x^12 + ...
G.f. = q + 2*q^10 + 2*q^37 + q^64 + 2*q^73 + 2*q^82 + 3*q^100 + ...
		

Crossrefs

Programs

  • Mathematica
    a[ n_] := If[ n < 0, 0, DivisorSum[ 9 n + 1, KroneckerSymbol[ -4, #] &]];
    a[ n_] := SeriesCoefficient[ EllipticTheta[ 3, 0, x] QPochhammer[ -x^7, x^18] QPochhammer[ -x^11, x^18] QPochhammer[ x^18], {x, 0, n}];
    a[ n_] := If[ n < 0, 0, Times @@ (Which[# < 3, 1, # == 3, Mod[#2, 2] 2 + 1, Mod[#, 4] == 1, #2 + 1, True, (1 + (-1)^#2) / 2] & @@@ FactorInteger[ 9 n + 1])];
  • PARI
    {a(n) = if( n<0, 0, sumdiv(9*n + 1, d, kronecker(-4, d)))};
    
  • PARI
    {a(n) = if( n<0, 0, my(m = 9*n + 1, k, s); forstep(j=0, sqrtint(m), 3, if( issquare(m - j^2, &k) && (k%9 == 1 || k%9 == 8), s+=(j>0)+1)); s)};
    
  • PARI
    {a(n) = if( n<0, 0, my(A, p, e); A = factor(9*n + 1); prod(k=1, matsize(A)[1], [p, e] = A[k, ]; if(p==2, 1, p==3, -2*(-1)^e, p%4==1, e+1, 1-e%2)))};

Formula

f(a,b) = 1 + Sum_{k=1..oo} (ab)^(k(k-1)/2)*(a^k+b^k). - N. J. A. Sloane, Jan 30 2017
Euler transform of a period 36 sequence.
G.f.: (Sum_{k in Z} x^k^2) * (Sum_{k in Z} x^(9*k^2 + 2*k)).
G.f.: Product_{k>0} (1 + x^(2*k-1))^2 * (1 - x^(2*k)) * (1 + x^(18*k-11)) * (1 + x^(18*k-7)) * (1 - x^(18*k)).
a(4*n + 2) = a(8*n + 5) = a(16*n + 3) = a(32*n + 31) = a(64*n + 55) = a(128*n + 39) = 0.
a(4*n + 3) = A281451(n). a(8*n + 1) = 2 * A281492(n). a(16*n + 7) = A281452(n). a(32*n + 15) = 2 * A281491(n). a(128*n + 103) = 2 * A281490(n).
a(n) = A122865(3*n) = A122856(6*n) = A258278(6*n) = a(64*n + 7). a(n) = -A256269(9*n + 1).
2 * a(n) = b(9*n + 1) where b = A105673, A122857, A258034, A259761. 2 * a(n) = - b(9*n+1) where b = A138949, A256280, A258292. 4 * a(n) = A004018(9*n + 1).
Convolution of A000122 and A205808.
Showing 1-4 of 4 results.