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.

Previous Showing 21-25 of 25 results.

A204617 Multiplicative with a(p^e) = p^(e-1)*H(p). H(2) = 1, H(p) = p - 1 if p == 1 (mod 4) and H(p) = p + 1 if p == 3 (mod 4).

Original entry on oeis.org

1, 1, 4, 2, 4, 4, 8, 4, 12, 4, 12, 8, 12, 8, 16, 8, 16, 12, 20, 8, 32, 12, 24, 16, 20, 12, 36, 16, 28, 16, 32, 16, 48, 16, 32, 24, 36, 20, 48, 16, 40, 32, 44, 24, 48, 24, 48, 32, 56, 20, 64, 24, 52, 36, 48, 32, 80, 28, 60, 32, 60, 32, 96, 32, 48, 48, 68, 32
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Maple
    with(numtheory):
    a := n->add(jacobi(-1,d)*mobius(d)*n/d, d in divisors(n)):
    seq(a(n), n = 1..60); # Peter Bala, Dec 26 2023
  • Mathematica
    ar[p_,s_] := Which[Mod[p,4]==1, p^(s-1)*(p-1), Mod[p,4]==3, p^(s-1)*(p+1), True,p^(s-1)]; arit[1] = 1; arit[n_] := Product[ar[FactorInteger[n][[i,1]], FactorInteger[n][[i,2]]], {i, Length[FactorInteger[n]]}]; Array[arit, 100]
  • PARI
    A204617(n) = { my(f=factor(n),p); prod(i=1, #f~, p=f[i, 1]; (p^(f[i, 2]-1)) * if(2==p,1,if(1==(p%4),p-1,p+1))); }; \\ Antti Karttunen, Nov 16 2021

Formula

a(n) = phi(n) if n is in A072437.
Sum_{k=1..n} a(k) ~ c * n^2, where c = (3/8) * Product_{primes p == 1 (mod 4)} (1 - 1/p^2) * Product_{primes p == 3 (mod 4)} (1 + 1/p^2) = 3*A243381/(8*A175647) = 0.409404... . - Amiram Eldar, Dec 24 2022
a(n) = n*Product_{primes p, p | n} (1 - A034947(p)/p) = Sum_{d | n} A034947(d)* mobius(d)*n/d. Cf. A000010(n) = Sum_{d | n} mobius(d)*n/d. - Peter Bala, Dec 26 2023
a(n) = A079458(n)/A062570(n). - Ridouane Oudra, Jun 04 2024

A086227 a(n) = Sum_{1<=k<=4*n, gcd(k,n)=1} (i^k*tan(k*Pi/(4*n)))/(4*i), where i is the imaginary unit.

Original entry on oeis.org

-1, 2, -2, 2, -4, 4, -4, 6, -4, 6, -8, 6, -8, 8, -8, 8, -12, 10, -8, 16, -12, 12, -16, 10, -12, 18, -16, 14, -16, 16, -16, 24, -16, 16, -24, 18, -20, 24, -16, 20, -32, 22, -24, 24, -24, 24, -32, 28, -20, 32, -24, 26, -36, 24, -32, 40, -28, 30, -32, 30, -32, 48, -32, 24, -48, 34, -32, 48, -32, 36, -48, 36, -36, 40, -40, 48, -48
Offset: 2

Views

Author

Benoit Cloitre, Aug 28 2003

Keywords

Comments

This seems to be (-1)^(n+1) times h(-4n^2) = (-1)^(n+1)*A000003(n^2), where h(k) is the class number. Verified for n <= 10^5. - Charles R Greathouse IV, Apr 28 2013

Crossrefs

Programs

  • Mathematica
    f[p_, e_] := p^(e - 1) * Switch[Mod[p, 4], 2, 1, 1, p - 1, 3, p + 1]; s[n_] := Times @@ f @@@ FactorInteger[n]; a[n_] := If[EvenQ[n], -s[n], s[n]/2]; Array[a, 100, 2] (* Amiram Eldar, Mar 07 2022 *)
  • PARI
    a(n)=round(real(1/4/I*sum(k=1,4*n,(I^k)*tan(Pi/4/n*if(gcd(k,n)-1,0,k)))))
    
  • PARI
    a(n)=round(imag(sum(k=1,4*n,if(gcd(k,n)==1,I^k*tan(k*Pi/4/n))))/4) \\ Charles R Greathouse IV, Apr 25 2013
    
  • PARI
    a(n)=my(s);for(k=1,2*n,if(gcd(2*k-1,n)==1,s-=(-1)^k*tan((2*k-1)*Pi/4/n))); round(s/4) \\ Charles R Greathouse IV, Apr 25 2013

Formula

a(n) = -A204617(n) if n is even, and A204617(n)/2 if n is odd (Rabinowitz, 1996). - Amiram Eldar, Mar 07 2022
a(n) = (-1)^(n+1)*A079458(n)/A140434(n). - Ridouane Oudra, Jun 23 2024

Extensions

Definition corrected by Charles R Greathouse IV, Apr 25 2013

A218147 Degree of minimal polynomial satisfied by exp(8*Pi*phi_2(1/n,1/n)), where phi_2 is defined in the Comments.

Original entry on oeis.org

2, 2, 4, 4, 12, 8, 18, 8, 30, 16, 36, 24, 32, 32, 64, 36, 90, 32, 96, 60, 132, 64, 100, 72, 162, 96, 196, 64, 240, 128, 240, 128, 192, 144, 324, 180, 288, 128, 400, 192, 462, 240, 288, 264, 552, 256, 588, 200, 512, 288, 676, 324, 480, 384, 720, 392, 870, 256
Offset: 3

Views

Author

Jason Kimberley, Oct 21 2012 and Apr 04 2016

Keywords

Comments

Crandall defines phi_2(r_1,r_2) = (1/Pi^2) Sum_{positive & negative odd m_1, m_2} cos(Pi m_1 r_1) cos(Pi m_2 r_2) / (m_1^2+m_2^2).
Lemma: 4a(n) < n^2. Proof: 4a(2) = 2 < 2^2; 4a(4k+1) = 16k^2 < (4k+1)^2; 4a(4k+3) = (4k+2)(4k+4) = (4k+3)^2-1; 4a(p^2 k) = 4p^2 a(pk) < p^2(pk)^2 = (p^2 k)^2; 4 a(jk) = 4 a(j) 4 a(k) < (jk)^2.
Corollary: a(n) <= A198442(n).

References

  • R. Crandall, The Poisson equation and "natural" Madelung constants, preprint 2012 (see section 2 of BBCZ below).

Crossrefs

Programs

Formula

a(n) = A079458(n) / 4, for n > 2. - Jason Kimberley, Nov 14 2015
Watson Ladd has proved that the sequence satisfies the following recurrence relations, which were conjectured by Jason Kimberley:
a(1) = 1/4, a(2) = 1/2, for notational convenience;
a(4k+1) = (2k)*(2k) for prime 4k+1;
a(4k+3) = (2k+1)*(2k+2) for prime 4k+3;
a(p^2 k) = p^2 * a(p*k) for prime p;
a(jk) = 4*a(j)*a(k) for j coprime to k.

Extensions

Entry revised by N. J. A. Sloane, May 15 2016, to take into account the fact that the conjectured formula for this sequence has now been established by Watson Ladd.

A302254 Exponent of the group of the Gaussian integers in a reduced system modulo (1+i)^n.

Original entry on oeis.org

1, 1, 2, 4, 4, 4, 4, 4, 8, 8, 16, 16, 32, 32, 64, 64, 128, 128, 256, 256, 512, 512, 1024, 1024, 2048, 2048, 4096, 4096, 8192, 8192, 16384, 16384, 32768, 32768, 65536, 65536, 131072, 131072, 262144, 262144, 524288, 524288, 1048576, 1048576, 2097152, 2097152, 4194304, 4194304, 8388608, 8388608
Offset: 0

Views

Author

Jianing Song, Apr 04 2018

Keywords

Comments

For n > 0, the number of elements in the group of the Gaussian integers in a reduced system modulo (1+i)^n is 2^(n-1).

Examples

			For Gaussian integer x such that (x, 1+i) = 1, x^4 - 1 = (x + 1)(x - 1)(x + i)(x - i) provides at least 7 factors of 1+i in total (and exactly 7 when x = 2+i), so a(7) = 4.
		

Crossrefs

Programs

  • Magma
    [1,1,2,4,4,4] cat [2^(Floor(n div 2)-1): n in [6..50]]; // Vincenzo Librandi, Apr 04 2018
  • Mathematica
    Join[{1, 1, 2, 4, 4, 4}, Table[2^(Floor[n/2] - 1), {n, 6, 50}]] (* Vincenzo Librandi, Apr 04 2018 *)

Formula

For n > 5, a(n) = 2^(floor(n/2) - 1).
For even n, a(n) = A227334(2^(n/2)).

A360323 a(n) is the number of solutions to gcd(a^2 + b^2, p) = 1 where p is the n-th prime and 0 <= a,b <= p-1.

Original entry on oeis.org

2, 8, 16, 48, 120, 144, 256, 360, 528, 784, 960, 1296, 1600, 1848, 2208, 2704, 3480, 3600, 4488, 5040, 5184, 6240, 6888, 7744, 9216, 10000, 10608, 11448, 11664, 12544, 16128, 17160, 18496, 19320, 21904, 22800, 24336, 26568, 27888, 29584, 32040, 32400, 36480
Offset: 1

Views

Author

Keywords

Comments

The prime numbers can be divided into 3 classes as follows, where 0 <= a,b <= p-1.
1. p = 2: The solutions are (0,1), (1,0).
2. p == 1 (mod 4): The number of solutions = p^2 - (number of solutions to a^2 + b^2 == 0 (mod p)). These primes can be written as the sum of two squares, so p = a^2 + b^2 == 0 (mod p). Hence, the number of possible values of (a,b) such that a^2 + b^2 == 0 (mod p) is 2*p - 1, so the final answer is p^2 - (2*p - 1) = (p-1)^2.
3. p == 3 (mod 4): These primes can't be written as the sum of two squares, so the number of possible values of (a,b) such that a^2 + b^2 == 0 (mod p) is 1 (that is, (0,0) only). Hence, the number of solutions for this case is p^2 - 1.

Examples

			a(2) = A079458(A000040(2)) = A079458(3) = 8.
		

Crossrefs

Formula

a(n) = A079458(A000040(n)).
Previous Showing 21-25 of 25 results.