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-6 of 6 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

A147809 Half the number of proper divisors (> 1) of n^2 + 1, i.e., tau(n^2 + 1)/2 - 1.

Original entry on oeis.org

0, 0, 1, 0, 1, 0, 2, 1, 1, 0, 1, 1, 3, 0, 1, 0, 3, 2, 1, 0, 3, 1, 3, 0, 1, 0, 3, 1, 1, 1, 3, 2, 3, 1, 1, 0, 3, 2, 1, 0, 2, 1, 5, 1, 1, 1, 7, 1, 1, 1, 1, 1, 3, 0, 3, 0, 7, 1, 1, 1, 1, 1, 3, 1, 1, 0, 3, 3, 1, 2, 1, 3, 7, 0, 3, 1, 3, 1, 1, 1, 3, 2, 7, 0, 1, 1, 3, 1, 3, 0, 3, 1, 5, 0, 1, 1, 3, 3, 5
Offset: 1

Views

Author

M. F. Hasler, Dec 13 2008

Keywords

Comments

For any n > 0, n^2 + 1 cannot be a square and thus has an even number of divisors which always include 1 and n^2 + 1, therefore a(n) = (half that number minus 1) is always a nonnegative integer.

Crossrefs

Programs

  • Mathematica
    DivisorSigma[0,Range[100]^2+1]/2-1 (* Harvey P. Dale, Feb 11 2015 *)
  • PARI
    A147809(n)=numdiv(n^2+1)/2-1

Formula

a(n) = A000005(A002522(n))/2 - 1 = A147810(n) - 1.
Sum_{k=1..n} a(k) ~ c * n * log(n), where c = 3/(2*Pi) = 0.477464... (A093582). - Amiram Eldar, Dec 01 2023

A147810 Half the number of divisors of n^2+1.

Original entry on oeis.org

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

Views

Author

M. F. Hasler, Dec 13 2008

Keywords

Comments

For any n>0, n^2+1 cannot be a square and thus has an even number of divisors which always include 1 and n^2+1, therefore a(n) is always a positive integer.
Also number of ways to write n^2+1 as n^2+1 = x*y with 1 <= x <= y. - Michel Lagneau, Mar 10 2014
Also number of ways to write arctan(1/n) = arctan(1/x)+arctan(1/y), for integral 0 < n < x < y. - Matthijs Coster, Dec 09 2014
Number of ways that n can be expressed as (j*k-1)/(j+k) with j >= k > n. For any nonnegative integer n, the equation j*k = 1+n*(j+k) always has at least one integer solution with j >= k > n. As j >= k > n, let k=n+c (c is a positive integer), then j=n+(n^2+1)/c; we can easily conclude that c <= n, i.e., for n > 0, a(n) is the number of divisors of (n^2+1) which are <= n. - Zhining Yang, May 18 2023

Examples

			For n = 7 the a(7) = 3 solutions are (17,12), (32,9), (57,8). For  n = 13 the a(13) = 4 solutions are (30,23), (47,18), (98,15), (183,14). - _Zhining Yang_, May 18 2023
		

Crossrefs

Programs

  • Maple
    with(numtheory); A147810:=n->tau(n^2+1)/2; seq(A147810(n), n=1..100); # Wesley Ivan Hurt, Mar 10 2014
  • Mathematica
    Table[c=0; Do[If[i<=j && i*j==n^2+1, c++], {i, t=Divisors[n^2+1]}, {j, t}]; c, {n, 100}] (* Michel Lagneau, Mar 10 2014 *)
  • PARI
    A147810(n)=numdiv(n^2+1)/2
    
  • Python
    from sympy import divisor_count
    def A147810(n): return divisor_count(n**2+1)>>1 if n else 1 # Chai Wah Wu, Jul 09 2023

Formula

a(n) = A000005(A002522(n))/2 = A147809(n)+1.
Sum_{k=1..n} a(k) ~ c * n * log(n), where c = 3/(2*Pi) = 0.477464... (A093582). - Amiram Eldar, Dec 01 2023

A147807 Partial sums of A147810(n) = tau(n^2 + 1)/2.

Original entry on oeis.org

1, 2, 4, 5, 7, 8, 11, 13, 15, 16, 18, 20, 24, 25, 27, 28, 32, 35, 37, 38, 42, 44, 48, 49, 51, 52, 56, 58, 60, 62, 66, 69, 73, 75, 77, 78, 82, 85, 87, 88, 91, 93, 99, 101, 103, 105, 113, 115, 117, 119, 121, 123, 127, 128, 132, 133, 141, 143, 145, 147, 149, 151, 155, 157
Offset: 1

Views

Author

M. F. Hasler, Dec 13 2008

Keywords

Comments

Also, number of inequivalent (i.e., q < r) integer solutions to 1/pqr = 1/p - 1/q - 1/r with p <= n; cf. A147811.

Crossrefs

Programs

  • Mathematica
    Accumulate[DivisorSigma[0, Range[64]^2 + 1]/2] (* Amiram Eldar, Oct 25 2019 *)
  • PARI
    s=0;A147807=vector(99,n,s+=numdiv(n^2+1))/2

Formula

a(n) = Sum_{p = 1..n} tau(1 + p^2)/2 = n + A147806(n) > n.
a(n) ~ c * n * log(n), where c = 3/(2*Pi) = 0.477464... (A093582). - Amiram Eldar, Dec 01 2023

A147806 Partial sums of A147809(n) = tau(n^2 + 1)/2 - 1.

Original entry on oeis.org

0, 0, 1, 1, 2, 2, 4, 5, 6, 6, 7, 8, 11, 11, 12, 12, 15, 17, 18, 18, 21, 22, 25, 25, 26, 26, 29, 30, 31, 32, 35, 37, 40, 41, 42, 42, 45, 47, 48, 48, 50, 51, 56, 57, 58, 59, 66, 67, 68, 69, 70, 71, 74, 74, 77, 77, 84, 85, 86, 87, 88, 89, 92, 93, 94, 94, 97, 100, 101, 103, 104, 107
Offset: 1

Views

Author

M. F. Hasler, Dec 13 2008

Keywords

Comments

It seems that a(10^n) = (6, 168, 2754, 38561, 495569, ...) ~ 1.1*(n-0.5)*10^n; otherwise said, a(n) ~ 1.1*(log_10(n)-0.5)*n, asymptotically.
The exact value of the coefficient above is 3*log(10)/(2*Pi) = 1.09940339... . - Amiram Eldar, Dec 01 2023

Crossrefs

Programs

  • Mathematica
    Accumulate[DivisorSigma[0, Range[72]^2 + 1]/2 - 1] (* Amiram Eldar, Oct 25 2019 *)
  • PARI
    s=0;a147806=vector(99,n,s+=numdiv(n^2+1))/2
    A147806(n)=sum(p=1,n,numdiv(n^2+1))/2-n

Formula

a(n) = A147807(n) - n.
a(n) ~ c * n * log(n), where c = 3/(2*Pi) = 0.477464... (A093582). - Amiram Eldar, Dec 01 2023

A289502 Mean width of the regular tetrahedron of unit length.

Original entry on oeis.org

9, 1, 2, 2, 6, 0, 1, 7, 1, 9, 5, 4, 0, 8, 9, 0, 9, 4, 7, 4, 3, 7, 1, 6, 6, 6, 1, 1, 6, 6, 3, 5, 3, 6, 3, 3, 0, 2, 5, 0, 5, 7, 0, 2, 5, 8, 4, 0, 8, 9, 9, 5, 6, 9, 0, 6, 8, 0, 9, 2, 5, 5, 2, 9, 6, 6, 9, 9, 7, 8, 8, 6, 9, 8, 3, 8, 3, 6, 6, 2, 9, 6, 9, 4, 6, 8, 2
Offset: 0

Views

Author

R. J. Mathar, Jul 07 2017

Keywords

Crossrefs

Programs

  • Maple
    x := 3*arccos(-1/3)/2/Pi ; evalf(%) ;
  • Mathematica
    RealDigits[3 ArcCos[-1/3]/(2*Pi), 10, 87][[1]] (* Indranil Ghosh, Jul 08 2017 *)

Formula

Showing 1-6 of 6 results.