A062570
a(n) = phi(2*n).
Original entry on oeis.org
1, 2, 2, 4, 4, 4, 6, 8, 6, 8, 10, 8, 12, 12, 8, 16, 16, 12, 18, 16, 12, 20, 22, 16, 20, 24, 18, 24, 28, 16, 30, 32, 20, 32, 24, 24, 36, 36, 24, 32, 40, 24, 42, 40, 24, 44, 46, 32, 42, 40, 32, 48, 52, 36, 40, 48, 36, 56, 58, 32, 60, 60, 36, 64, 48, 40, 66, 64, 44, 48, 70, 48, 72
Offset: 1
- T. M. Apostol, Introduction to Analytic Number Theory, Springer-Verlag, 1976, p. 28.
- Antti Karttunen, Table of n, a(n) for n = 1..65537 (first 1000 terms from Vincenzo Librandi)
- N. J. A. Sloane, Families of Essentially Identical Sequences, Mar 24 2021 (Includes this sequence).
- László Tóth, Counting solutions of quadratic congruences in several variables revisited, arXiv preprint arXiv:1404.4214 [math.NT], 2014.
- László Tóth, Counting Solutions of Quadratic Congruences in Several Variables Revisited, J. Int. Seq. 17 (2014), Article 14.11.6.
- Wikipedia, Ramanujan's sum.
A087786
a(n) = number of solutions to x^3 - y^3 == 0 (mod n).
Original entry on oeis.org
1, 2, 3, 6, 5, 6, 19, 20, 27, 10, 11, 18, 37, 38, 15, 40, 17, 54, 55, 30, 57, 22, 23, 60, 45, 74, 135, 114, 29, 30, 91, 112, 33, 34, 95, 162, 109, 110, 111, 100, 41, 114, 127, 66, 135, 46, 47, 120, 175, 90, 51, 222, 53, 270, 55, 380, 165, 58, 59, 90, 181, 182, 513, 352, 185
Offset: 1
Yuval Dekel (dekelyuval(AT)hotmail.com), Oct 06 2003
-
a(n)={my(v=vector(n)); for(i=0, n-1, v[i^3%n + 1]++); sum(i=0, n-1, v[i+1]^2)} \\ Andrew Howroyd, Jul 17 2018
-
a(n)={my(f=factor(n)); prod(i=1, #f~, my(p=f[i,1], e=f[i,2]); p^(2*(2*e\3)) + sum(i=0, (e-1)\3, if(p%3==1 || (p==3&&3*iAndrew Howroyd, Jul 17 2018
A086933
Number of solutions to x^2 + y^2 = 0 mod n.
Original entry on oeis.org
1, 2, 1, 4, 9, 2, 1, 8, 9, 18, 1, 4, 25, 2, 9, 16, 33, 18, 1, 36, 1, 2, 1, 8, 65, 50, 9, 4, 57, 18, 1, 32, 1, 66, 9, 36, 73, 2, 25, 72, 81, 2, 1, 4, 81, 2, 1, 16, 49, 130, 33, 100, 105, 18, 9, 8, 1, 114, 1, 36, 121, 2, 9, 64, 225, 2, 1, 132, 1, 18, 1, 72, 145, 146, 65, 4, 1, 50, 1, 144, 81
Offset: 1
Yuval Dekel (dekelyuval(AT)hotmail.com), Sep 21 2003
- Andrew Howroyd, Table of n, a(n) for n = 1..10000
- S. R. Finch, Series involving arithmetric functions.
- N. Gafurov, On the number of divisors of a quadratic form, Proc. Steklov Inst. Math. 200 (1993) 137-148.
- L. Tóth, Counting solutions of quadratic congruences in several variables revisited, arXiv preprint arXiv:1404.4214 [math.NT], 2014.
- L. Toth, Counting Solutions of Quadratic Congruences in Several Variables Revisited, J. Int. Seq. 17 (2014) # 14.11.6.
- G. Yu, On the number of divisors of the quadratic form m^2+n^2, Canad. Math. Bull. 43 (2000) 239-256.
-
a[n_] := a[n] = Module[{f, p, e}, f = FactorInteger[n]; Switch[f, {{2, }}, Return[n], {{, }}, {p, e} = f[[1]]; If[Mod[p, 4] == 3, Return[p^(e - Mod[e, 2])], Return[((p-1)*e+p)*p^(e-1)]], , Times @@ (a[#[[1]]^#[[2]]]& /@ f)]];
Array[a, 81] (* Jean-François Alcover, Aug 21 2018, after Vladeta Jovovic *)
-
ap(p,e)=if(p%4<2, ((p-1)*e+p)*p^(e-1), p^(e - e%2))
a(n)=my(o=valuation(n,2),f=factor(n>>o)); prod(i=1,#f~, ap(f[i,1],f[i,2]))<Charles R Greathouse IV, Dec 06 2016
A088964
Number of solutions to x^2 == 2y^2 (mod n).
Original entry on oeis.org
1, 2, 1, 4, 1, 2, 13, 8, 9, 2, 1, 4, 1, 26, 1, 16, 33, 18, 1, 4, 13, 2, 45, 8, 25, 2, 9, 52, 1, 2, 61, 32, 1, 66, 13, 36, 1, 2, 1, 8, 81, 26, 1, 4, 9, 90, 93, 16, 133, 50, 33, 4, 1, 18, 1, 104, 1, 2, 1, 4, 1, 122, 117, 64, 1, 2, 1, 132, 45, 26
Offset: 1
Yuval Dekel (dekelyuval(AT)hotmail.com), Oct 28 2003
-
A088964 := proc(n) local a,x,y ; a := 0 ; for x from 0 to n-1 do for y from 0 to n-1 do if (x^2-2*y^2) mod n = 0 then a := a+1 ; end if; end do; end do ; a ; end proc:
seq(A088964(n),n=1..70) ; # R. J. Mathar, Jan 07 2011
-
a[n_] := Product[{p, e} = pe; Which[p == 2, 2^e, Abs[Mod[p, 8] - 4] == 1, (p^2)^Quotient[e, 2], True, (p+e(p-1))p^(e-1)], {pe, FactorInteger[n]}];
Array[a, 100] (* Jean-François Alcover, Apr 08 2020, after Andrew Howroyd *)
f[2, e_] := 2^e; f[p_, e_] := If[MemberQ[{1, 7}, Mod[p, 8]], ((p-1)*e + p)*p^(e-1), p^(2*Floor[e/2])]; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Sep 20 2020 *)
-
a(n)={my(v=vector(n)); for(i=0, n-1, v[i^2%n + 1]++); sum(i=0, n-1, v[i+1]*v[2*i%n + 1])} \\ Andrew Howroyd, Jul 09 2018
-
a(n)={my(f=factor(n)); prod(i=1, #f~, my(p=f[i,1], e=f[i,2]); if(p==2, 2^e, if(abs(p%8-4)==1, (p^2)^(e\2), (p+e*(p-1))*p^(e-1))))} \\ Andrew Howroyd, Jul 09 2018
A306271
a(n) is the smallest positive integer x such that x^2 mod n is a square, with x^2 >= n.
Original entry on oeis.org
1, 2, 2, 2, 3, 4, 5, 3, 3, 7, 8, 4, 10, 11, 4, 4, 13, 6, 15, 6, 5, 18, 19, 5, 5, 21, 6, 9, 24, 8, 26, 6, 7, 29, 6, 6, 31, 32, 8, 7, 35, 10, 37, 16, 7, 40, 41, 7, 7, 10, 10, 19, 46, 12, 8, 9, 14, 51, 52, 8, 54, 55, 8, 8, 9, 14, 59, 26, 16, 12, 63, 9, 65, 66, 10
Offset: 1
For n = 10, a(10) = 7, which is the smallest positive integer x such that x^2 mod n is a square and that x^2 >= n. Here 7^2 mod 10 = 9 = 3^2.
-
a:= proc(n) local k, t;
for k do t:= irem(k^2, n);
if issqr(t) and isqrt(t)<>k then break fi
od; k
end:
seq(a(n), n=1..100); # Alois P. Heinz, Feb 01 2019
-
a[n_] := For[x = Sqrt[n]//Ceiling, True, x++, If[IntegerQ[Sqrt[PowerMod[x, 2, n]]], Return[x]]];
Array[a, 100] (* Jean-François Alcover, Nov 07 2020 *)
-
a(n) = for(k=sqrtint(n), oo, if(issquare(k^2 % n) && sqrtint(k^2 % n) != k, return(k)));
A366561
Triangle read by rows: T(n,k) = Sum_{y=1..n} Sum_{x=1..n} [GCD(f(x,y), n) = k], where f(x,y) = x^2 - y^2.
Original entry on oeis.org
1, 2, 2, 4, 0, 5, 8, 0, 0, 8, 16, 0, 0, 0, 9, 8, 8, 10, 0, 0, 10, 36, 0, 0, 0, 0, 0, 13, 32, 0, 0, 8, 0, 0, 0, 24, 36, 0, 24, 0, 0, 0, 0, 0, 21, 32, 32, 0, 0, 18, 0, 0, 0, 0, 18, 100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 32, 0, 40, 32, 0, 0, 0, 0, 0, 0, 0, 40
Offset: 1
{
{1}, = 1^2
{2, 2}, = 2^2
{4, 0, 5}, = 3^2
{8, 0, 0, 8}, = 4^2
{16, 0, 0, 0, 9}, = 5^2
{8, 8, 10, 0, 0, 10}, = 6^2
{36, 0, 0, 0, 0, 0, 13}, = 7^2
{32, 0, 0, 8, 0, 0, 0, 24}, = 8^2
{36, 0, 24, 0, 0, 0, 0, 0, 21}, = 9^2
{32, 32, 0, 0, 18, 0, 0, 0, 0, 18}, = 10^2
{100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21}, = 11^2
{32, 0, 40, 32, 0, 0, 0, 0, 0, 0, 0, 40} = 12^2
}
-
nn = 12; f = x^2 - y^2; g[n_] := DivisorSum[n, MoebiusMu[#] # &]; Flatten[Table[Table[Sum[Sum[If[GCD[f, n] == k, 1, 0], {x, 1, n}], {y, 1, n}], {k, 1, n}], {n, 1, nn}]]
-
T(n,k) = sum(x=1, n, sum(y=1, n, gcd(x^2 - y^2, n) == k)); \\ Michel Marcus, Oct 14 2023
A235872
Number of solutions to the equation x^2=0 in the ring of Gaussian integers modulo n.
Original entry on oeis.org
1, 2, 1, 4, 1, 2, 1, 8, 9, 2, 1, 4, 1, 2, 1, 16, 1, 18, 1, 4, 1, 2, 1, 8, 25, 2, 9, 4, 1, 2, 1, 32, 1, 2, 1, 36, 1, 2, 1, 8, 1, 2, 1, 4, 9, 2, 1, 16, 49, 50, 1, 4, 1, 18, 1, 8, 1, 2, 1, 4, 1, 2, 9, 64, 1, 2, 1, 4, 1, 2, 1, 72, 1, 2, 25, 4, 1, 2, 1, 16, 81, 2
Offset: 1
-
invoG[n_] := invoG[n] = Sum[If[Mod[(x + I y)^2, n] == 0, 1, 0], {x, 0, n - 1}, {y, 0, n - 1}]; Table[invoG[n], {n, 1, 104}]
f[p_, e_] := p^(2*Floor[e/2]); f[2, e_] := 2^e; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Nov 13 2022 *)
-
a(n)={sum(i=0, n-1, sum(j=0, n-1, (i^2 - j^2)%n == 0 && 2*i*j%n == 0))} \\ Andrew Howroyd, Aug 06 2018
-
a(n)={my(f=factor(n)); prod(i=1, #f~, my([p,e]=f[i,]); p^if(p==2, e, e - e%2))} \\ Andrew Howroyd, Aug 06 2018
Showing 1-7 of 7 results.
Comments