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-3 of 3 results.

A306653 a(n) = Sum_{m=1..n} Sum_{k=1..n} [k divides n]*[n/k divides m]*A008683(n/k)*n/k*[k divides m + 2^p]*A008683(k)*k, where p can be a positive integer: 1,2,3,4,5,...

Original entry on oeis.org

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

Views

Author

Mats Granvik, Mar 03 2019

Keywords

Comments

It appears that for p=1 and p=2, a(n) is identically the same for all n except for n equal to multiples of 16. See A306652 for comparison.

Crossrefs

Programs

  • Mathematica
    (* Dirichlet Convolution. *)
    p=1;
    a[n_] := 1/n*Sum[Sum[If[Mod[n, k] == 0, 1, 0]*If[Mod[m, n/k] == 0, 1, 0]*If[Mod[m + 2^p, k] == 0, 1, 0]*MoebiusMu[n/k]*n/k*MoebiusMu[k]*k, {k, 1, n}], {m, 1, n}]; a /@ Range[85]
    (* conjectured faster program *)
    nn = 85;
    b = 4*Select[Range[1, nn, 2], SquareFreeQ];
    bb = Table[DivisorSigma[0, n]*(MoebiusMu[n] + Sum[If[b[[j]] == n, LiouvilleLambda[n]*2/3, 0], {j, 1, Length[b]}]), {n, 1, nn}]
  • PARI
    A306653(n) = (1/n)*sum(m=1, n, sumdiv(n, k, if( !(m%(n/k)) && !((m+(2^1))%k), n*moebius(n/k)*moebius(k),0))); \\ Antti Karttunen, Mar 15 2019

Formula

a(n) = 1/n * Sum_{m=1..n} Sum_{k=1..n} [k divides n]*[n/k divides m]*[k divides m + 2^p]*A008683(n/k)*n/k*A008683(k)*k, where p can be any positive integer: 1,2,3,4,5,...
a(n) = A000005(n)*(A008683(n) + Sum_{j=1..n} [4*A056911(j)=n]*A008836(n)*2/3) (conjectured formula verified for n=1..2500).
Dirichlet generating function, after Daniel Suteu in A298826 and Álvar Ibeas in A076479, appears to be: Sum_{n>=1} a(n)/n^s = (Product_{j>=1} (1 - 2*prime(j)^(-s)))*(1 + Sum_{n>=2} (1/2/2^(n*(s - 1)))). - Mats Granvik, Apr 07 2019
The conjectured Dirichlet generating function simplifies to: Sum_{n>=1} a(n)/n^s = (Product_{j>=1} (1 - 2*prime(j)^(-s)))*(1 + 2^(1 - s)/(2^s - 2)). - Steven Foster Clark, Sep 23 2022

A235384 Number of involutions in the group Aff(Z/nZ).

Original entry on oeis.org

2, 4, 6, 6, 8, 8, 16, 10, 12, 12, 24, 14, 16, 24, 28, 18, 20, 20, 36, 32, 24, 24, 64, 26, 28, 28, 48, 30, 48, 32, 52, 48, 36, 48, 60, 38, 40, 56, 96, 42, 64, 44, 72, 60, 48, 48, 112, 50, 52, 72, 84, 54, 56, 72, 128, 80, 60, 60, 144, 62, 64, 80, 100, 84
Offset: 2

Views

Author

Tom Edgar, Jan 08 2014

Keywords

Comments

Aff(Z/nZ) is the group of functions on Z/nZ of the form x->ax+b where a and b are elements of Z/nZ and gcd(a,n)=1.
Since Aff(Z/nZ) is isomorphic to the automorphism group of the dihedral group with 2n elements (when n>=3), this is the number of automorphisms of the dihedral group with 2n elements that have order 1 or 2.
The sequence is multiplicative: a(k*m) = a(k)*a(m) if m and k are coprime.
When n=26, this is the number of affine ciphers where encryption and decryption use the same function.

Examples

			Since 18 = 2*3^2, we get a(18) = 2*(3^2+1) = 20. Since 120 = 2^3*3*5, we have a(120) = (4+2^2+2^3)*(3+1)*(5+1) = 384.
		

Crossrefs

Programs

  • Maple
    a:= n-> add(`if`(irem(k^2, n)=1, igcd(n, k+1), 0), k=1..n-1):
    seq(a(n), n=2..100);  # Alois P. Heinz, Jan 20 2014
  • Mathematica
    a[n_] := Sum[If[Mod[k^2, n] == 1, GCD[n, k+1], 0], {k, 1, n-1}]; Table[a[n], {n, 2, 100}] (* Jean-François Alcover, Mar 24 2014, after Alois P. Heinz *)
    f[p_, e_] := p^e + 1; f[2, 1] = 2; f[2, 2] = 6; f[2, e_] := 3*2^(e - 1) + 4; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100, 2]  (* Amiram Eldar, Dec 05 2022 *)
  • PARI
    A034448(n,f=factor(n))=factorback(vector(#f~,i,f[i,1]^f[i,2]+1))
    a(n)=my(m=valuation(n,2)); if(m==0,1,m==1,2,m==2,6,4+3<<(m-1))*A034448(n>>m) \\ Charles R Greathouse IV, Jul 29 2016
  • Sage
    def a(n):
        L=list(factor(n))
        if L[0][0]==2:
            m=L[0][1]
            L.pop(0)
        else:
            m=0
        order=prod([x[0]^x[1]+1 for x in L])
        if m==1:
            order=2*order
        elif m==2:
            order=6*order
        elif m>=3:
            order=(4+2^(m-1)+2^m)*order
        return order
    [a(i) for i in [2..100]]
    
  • Sage
    def b(n):
        sum = 0
        for a in [x for x in range(n) if ((x^2) % n == 1)]:
            sum += gcd(a+1,n)
        return sum
    [b(i) for i in [2..100]]
    

Formula

Suppose n = 2^m*p_1^(r_1)*p_2^(r_2)*...*p_k^(r_k) where each p_i>2 is prime, r_i>0 for all i, and m>=0 is the prime factorization of n, then:
...a(n) = Product_{1<=i<=k} (p_i^(r_i)+1) if m=0,
...a(n) = 2*Product_{1<=i<=k} (p_i^(r_i)+1) if m=1,
...a(n) = 6*Product_{1<=i<=k} (p_i^(r_i)+1) if m=2,
...a(n) = (4+2^(m-1)+2^m)*Product_{1<=i<=k} (p_i^(r_i)+1) if m>=3.
a(n) = Sum_{a in row(n) of A228179} gcd(a+1,n).
Sum_{k=1..n} a(k) ~ c * n^2, where c = zeta(2)/(2*zeta(3)) = 0.684216... (A335005). - Amiram Eldar, Dec 05 2022

A306652 a(n) = Sum_{m=1..n} Sum_{k=1..n} [k divides n]*[n/k divides m]*[k divides m + 4].

Original entry on oeis.org

1, 2, 2, 4, 2, 4, 2, 6, 2, 4, 2, 8, 2, 4, 4, 10, 2, 4, 2, 8, 4, 4, 2, 12, 2, 4, 2, 8, 2, 8, 2, 14, 4, 4, 4, 8, 2, 4, 4, 12, 2, 8, 2, 8, 4, 4, 2, 20, 2, 4, 4, 8, 2, 4, 4, 12, 4, 4, 2, 16, 2, 4, 4, 14, 4, 8, 2, 8, 4, 8, 2, 12, 2, 4, 4, 8, 4, 8, 2, 20, 2, 4, 2, 16, 4
Offset: 1

Views

Author

Mats Granvik, Mar 03 2019

Keywords

Comments

According to the first Hardy-Littlewood conjecture, the cousin primes have the same asymptotic density as the twin primes. In an analogy of Dirichlet convolutions A147848 corresponds to the twin primes while this sequence corresponds to the cousin primes, and it appears that this sequence differs from A147848 at multiples of 16. See A306653 for comparison.

Crossrefs

Programs

  • Mathematica
    a[n_] := Sum[Sum[If[Mod[n, k] == 0, If[Mod[m, n/k] == 0, 1, 0], 0]*If[Mod[m + 4, k/1] == 0, 1, 0], {k, 1, n}], {m, 1, n}]; a /@Range[85] (* Dirichlet Convolution. *)
    a[n_] := Sum[If[Mod[n, k] == 0, Sum[If[Mod[4, j] == 0, If[GCD[k, n/k] == j, j, 0], 0], {j, 1, n}], 0], {k, 1, n}]; a /@Range[85] (* GCD sum. *)
    a[n_] := Sum[If[Mod[4, j] == 0, j*Count[Divisors[n], d_ /; GCD[d, n/d] == j], 0], {j, 1, n}]; a /@Range[85] (* After Jean-François Alcover in A034444. *)
  • PARI
    A306652(n) = sum(m=1, n, sumdiv(n, k, !(m%(n/k)) && !((m+4)%k))); \\ Antti Karttunen, Mar 13 2019

Formula

a(n) = Sum_{m=1..n} Sum_{k=1..n} [k divides n]*[n/k divides m]*[k divides m + 4].
a(n) = Sum_{k=1..n}[k divides n]*Sum_{j=1..n}[j divides 4]*[GCD[k, n/k] = j]*j.
Showing 1-3 of 3 results.