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

A267099 Fully multiplicative involution swapping the positions of 4k+1 and 4k+3 primes: a(1) = 1; a(prime(k)) = A267101(k), a(x*y) = a(x)*a(y) for x, y > 1.

Original entry on oeis.org

1, 2, 5, 4, 3, 10, 13, 8, 25, 6, 17, 20, 7, 26, 15, 16, 11, 50, 29, 12, 65, 34, 37, 40, 9, 14, 125, 52, 19, 30, 41, 32, 85, 22, 39, 100, 23, 58, 35, 24, 31, 130, 53, 68, 75, 74, 61, 80, 169, 18, 55, 28, 43, 250, 51, 104, 145, 38, 73, 60, 47, 82, 325, 64, 21, 170, 89, 44, 185, 78, 97, 200, 59, 46, 45, 116, 221, 70, 101
Offset: 1

Views

Author

Antti Karttunen, Feb 01 2016

Keywords

Comments

Lexicographically earliest self-inverse permutation of natural numbers where each prime of the form 4k+1 is replaced by a prime of the form 4k+3 and vice versa, with the composite numbers determined by multiplicativity.
Fully multiplicative with a(p_n) = p_{A267100(n)} = A267101(n).
Maps each term of A004613 to some term of A004614, each (nonzero) term of A001481 to some term of A268377 and each term of A004431 to some term of A268378 and vice versa.
Sequences A072202 and A078613 are closed with respect to this permutation.

Crossrefs

Cf. A000035, A000040, A000720, A010051, A020639, A032742, A267100, A267101, A354102 (Möbius transform), A354103 (inverse Möbius transform), A354192 (fixed points).
Cf. also A108548.

Programs

  • PARI
    up_to = 2^16;
    A267097list(up_to) = { my(v=vector(up_to),i=0,c=0); forprime(p=2,prime(up_to), if(1==(p%4), c++); i++; v[i] = c); (v); };
    v267097 = A267097list(up_to);
    A267097(n) = v267097[n];
    A267098(n) = ((n-1)-A267097(n));
    list_primes_of_the_form(up_to,m,k) = { my(v=vector(up_to),i=0); forprime(p=2,, if(k==(p%m), i++; v[i] = p; if(i==up_to,return(v)))); };
    v002144 = list_primes_of_the_form(2*up_to,4,1);
    A002144(n) = v002144[n];
    v002145 = list_primes_of_the_form(2*up_to,4,3);
    A002145(n) = v002145[n];
    A267101(n) = if(1==n,2,if(1==(prime(n)%4),A002145(A267097(n)),A002144(A267098(n))));
    A267099(n) = { my(f=factor(n)); for(k=1,#f~,f[k,1] = A267101(primepi(f[k,1]))); factorback(f); }; \\ Antti Karttunen, May 18 2022
    (Scheme, with memoization-macro definec)
    (definec (A267099 n) (cond ((<= n 1) n) ((= 1 (A010051 n)) (A267101 (A000720 n))) (else (* (A267099 (A020639 n)) (A267099 (A032742 n))))))

Formula

a(1) = 1; after which, if n is k-th prime [= A000040(k)], then a(n) = A267101(k), otherwise a(A020639(n)) * a(A032742(n)).
Other identities. For all n >= 1:
a(A000040(n)) = A267101(n).
a(2*n) = 2*a(n).
a(3*n) = 5*a(n).
a(5*n) = 3*a(n).
a(7*n) = 13*a(n).
a(11*n) = 17*a(n).
etc. See examples in A267101.
A000035(n) = A000035(a(n)). [Preserves the parity of n.]
A005094(a(n)) = -A005094(n).
A079635(a(n)) = -A079635(n).

Extensions

Verbal description prefixed to the name by Antti Karttunen, May 19 2022

A005091 Number of distinct primes = 3 mod 4 dividing n.

Original entry on oeis.org

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

Views

Author

Keywords

Crossrefs

Programs

  • Haskell
    a005091 = sum . map a079261 . a027748_row
    -- Reinhard Zumkeller, Jan 07 2013
    
  • Magma
    [0] cat [#[p:p in PrimeDivisors(n)| p mod 4 eq 3]: n in [2..100]]; // Marius A. Burtea, Nov 19 2019
    
  • Magma
    [0] cat [&+[Binomial(p,3) mod 2:p in PrimeDivisors(n)]:n in [2..100]]; // Marius A. Burtea, Nov 19 2019
    
  • Maple
    with(numtheory): seq(add(binomial(p,3) mod 2, p in factorset(n)), n=1..100); # Ridouane Oudra, Nov 19 2019
  • Mathematica
    f[n_]:=Length@Select[If[n==1,{},FactorInteger[n]],Mod[#[[1]],4]==3&]; Table[f[n],{n,102}] (* Ray Chandler, Dec 18 2011 *)
  • PARI
    for(n=1,100,print1(sumdiv(n,d,isprime(d)*if((d-3)%4,0,1)),","))
    
  • Python
    from sympy import primefactors
    def A005091(n): return sum(1 for p in primefactors(n) if p&3==3) # Chai Wah Wu, Jul 07 2024

Formula

Additive with a(p^e) = 1 if p = 3 (mod 4), 0 otherwise.
From Reinhard Zumkeller, Jan 07 2013: (Start)
a(n) = Sum_{k=1..A001221(n)} A079261(A027748(n,k)).
a(A072437(n)) = 0.
a(A187811(n)) > 0. (End)
a(n) = Sum_{p|n} (binomial(p,3) mod 2), where p is a prime. - Ridouane Oudra, Nov 19 2019

A005089 Number of distinct primes == 1 (mod 4) dividing n.

Original entry on oeis.org

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

Views

Author

Keywords

Crossrefs

Cf. A001221, A005091, A005094, A083025 (with multiplicity).

Programs

  • Haskell
    a005089 = sum . map a079260 . a027748_row
    -- Reinhard Zumkeller, Jan 07 2013
    
  • Magma
    [#[p:p in PrimeDivisors(n)|p mod 4 eq 1]: n in [1..100]]; // Marius A. Burtea, Jan 16 2020
  • Maple
    A005089 := proc(n)
        local a,pe;
        a := 0 ;
        for pe in ifactors(n)[2] do
            if modp(op(1,pe),4) =1 then
                a := a+1 ;
            end if;
        end do:
        a ;
    end  proc:
    seq(A005089(n),n=1..100) ; # R. J. Mathar, Jul 22 2021
  • Mathematica
    f[n_]:=Length@Select[If[n==1,{},FactorInteger[n]],Mod[#[[1]],4]==1&]; Table[f[n],{n,102}] (* Ray Chandler, Dec 18 2011 *)
    a[n_] := DivisorSum[n, Boole[PrimeQ[#] && Mod[#, 4] == 1]&]; Array[a, 100] (* Jean-François Alcover, Dec 01 2015 *)
  • PARI
    for(n=1,100,print1(sumdiv(n,d,isprime(d)*if((d-1)%4,0,1)),","))
    

Formula

Additive with a(p^e) = 1 if p == 1 (mod 4), 0 otherwise.
From Reinhard Zumkeller, Jan 07 2013: (Start)
a(n) = Sum_{k=1..A001221(n)} A079260(A027748(n,k)).
a(A004144(n)) = 0.
a(A009003(n)) > 0. (End)

A079635 Sum of (2 - p mod 4) for all prime factors p of n (with repetition).

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Jan 30 2003

Keywords

Comments

a(n) = {number of primes of the form 4k+1 dividing n} minus {number of primes of the form 4k+3 dividing n}, both counted with multiplicity. - Antti Karttunen, Feb 03 2016, after the formula.

Examples

			a(55) = a(5*11) = (2 - 5 mod 4)+(2 - 11 mod 4) = (2-1)+(2-3) = (1)+(-1) = 0.
		

Crossrefs

Cf. A072202 (indices of zeros), A268379 (of strictly positive terms), A268380 (of negative terms), A268381 (of nonnegative terms).
Cf. A005094 (difference when counting only distinct primes).

Programs

  • Haskell
    a079635 1 = 0
    a079635 n = sum $ map ((2 - ) . (`mod` 4)) $ a027746_row n
    -- Reinhard Zumkeller, Jan 10 2012
    
  • Maple
    f:= proc(n) local t;
    add(t[2]*(2-(t[1] mod 4)), t=ifactors(n)[2])
    end proc:
    map(f, [$1..100]); # Robert Israel, Feb 05 2016
  • Mathematica
    f[n_]:=Plus@@((2-Mod[#[[1]],4])*#[[2]]&/@If[n==1,{},FactorInteger[n]]); Table[f[n],{n,100}] (* Ray Chandler, Dec 20 2011 *)
  • Scheme
    (define (A079635 n) (- (A083025 n) (A065339 n))) ;; Antti Karttunen, Feb 03 2016

Formula

a(n) = A083025(n) - A065339(n).
Other identities. For all n >= 1:
a(A267099(n)) = -a(n). - Antti Karttunen, Feb 03 2016
Totally additive with a(2) = 0, a(p) = 1 if p == 1 (mod 4), and a(p) = -1 if p == 3 (mod 4). - Amiram Eldar, Jun 17 2024

Extensions

Edited by Ray Chandler, Dec 20 2011

A078613 Same numbers of distinct prime factors of forms 4*k+1 and 4*k+3.

Original entry on oeis.org

1, 2, 4, 8, 15, 16, 30, 32, 35, 39, 45, 51, 55, 60, 64, 70, 75, 78, 87, 90, 91, 95, 102, 110, 111, 115, 117, 119, 120, 123, 128, 135, 140, 143, 150, 153, 155, 156, 159, 174, 175, 180, 182, 183, 187, 190, 203, 204, 215, 219, 220, 222, 225, 230, 234, 235, 238, 240
Offset: 1

Views

Author

Reinhard Zumkeller, Dec 10 2002

Keywords

Comments

Equivalently, numbers n such that A005089(n)=A005091(n); A005094(a(n))=0.
A001221(a(n)) and a(n) are of opposite parity.
If m is in the sequence, then also 2*m.
Conjecture : a(n) is asymptotic to c*n where c is around 4 - Benoit Cloitre, Jan 06 2003

Examples

			n = 99 = [(4*0+3)^2]*[(4*1+1)], therefore 99 is a term.
		

Crossrefs

Programs

  • Haskell
    a078613 n = a078613_list !! (n-1)
    a078613_list = filter ((== 0) . a005094) [1..]
    -- Reinhard Zumkeller, Jan 07 2013
  • Mathematica
    fQ[n_]:=Plus@@((Mod[#[[1]],4]-2)&/@If[n==1,{},FactorInteger[n]])==0; Select[Range[240],fQ] (* Ray Chandler, Dec 18 2011*)

Extensions

Edited by Ray Chandler, Dec 18 2011

A221264 Numbers having fewer distinct prime factors of form 4*k+1 than of 4*k+3.

Original entry on oeis.org

3, 6, 7, 9, 11, 12, 14, 18, 19, 21, 22, 23, 24, 27, 28, 31, 33, 36, 38, 42, 43, 44, 46, 47, 48, 49, 54, 56, 57, 59, 62, 63, 66, 67, 69, 71, 72, 76, 77, 79, 81, 83, 84, 86, 88, 92, 93, 94, 96, 98, 99, 103, 105, 107, 108, 112, 114, 118, 121, 124, 126, 127, 129
Offset: 1

Views

Author

Reinhard Zumkeller, Jan 07 2013

Keywords

Comments

A005089(a(n)) < A005091(a(n)); A005094(a(n)) < 0.

Crossrefs

Programs

  • Haskell
    a221264 n = a221264_list !! (n-1)
    a221264_list = filter ((< 0) . a005094) [1..]
    
  • PARI
    is_A221264(n)={#(n=vecsort(factor(n>>valuation(n,2))[,1]%4))&&n[(1+#n)\2]==3} \\ M. F. Hasler, Dec 17 2014

A221265 Numbers having more distinct prime factors of form 4*k+1 than of 4*k+3.

Original entry on oeis.org

5, 10, 13, 17, 20, 25, 26, 29, 34, 37, 40, 41, 50, 52, 53, 58, 61, 65, 68, 73, 74, 80, 82, 85, 89, 97, 100, 101, 104, 106, 109, 113, 116, 122, 125, 130, 136, 137, 145, 146, 148, 149, 157, 160, 164, 169, 170, 173, 178, 181, 185, 193, 194, 195, 197, 200, 202
Offset: 1

Views

Author

Reinhard Zumkeller, Jan 07 2013

Keywords

Comments

A005089(a(n)) > A005091(a(n)); A005094(a(n)) > 0.

Crossrefs

Programs

  • Haskell
    a221265 n = a221265_list !! (n-1)
    a221265_list = filter ((> 0) . a005094) [1..]
  • Mathematica
    mdpf1Q[n_]:=Module[{f=Transpose[FactorInteger[n]][[1]]},Count[f,?(Mod[ #,4] == 1&)]>Count[f,?(Mod[#,4]==3&)]]; Select[Range[2,250],mdpf1Q] (* Harvey P. Dale, Mar 03 2016 *)

A368647 The number of distinct primes of the form 3*k+2 dividing n minus the number of distinct primes of the form 3*k+1 dividing n.

Original entry on oeis.org

0, 1, 0, 1, 1, 1, -1, 1, 0, 2, 1, 1, -1, 0, 1, 1, 1, 1, -1, 2, -1, 2, 1, 1, 1, 0, 0, 0, 1, 2, -1, 1, 1, 2, 0, 1, -1, 0, -1, 2, 1, 0, -1, 2, 1, 2, 1, 1, -1, 2, 1, 0, 1, 1, 2, 0, -1, 2, 1, 2, -1, 0, -1, 1, 0, 2, -1, 2, 1, 1, 1, 1, -1, 0, 1, 0, 0, 0, -1, 2, 0, 2
Offset: 1

Views

Author

Amiram Eldar, Jan 02 2024

Keywords

Crossrefs

Programs

  • Mathematica
    f[p_, e_] := Switch[Mod[p, 3], 0, 0, 1, -1, 2, 1]; a[1] = 0; a[n_] := Plus @@ f @@@ FactorInteger[n]; Array[a, 100]
  • PARI
    a(n) = {my(p = factor(n)[, 1]); sum(i = 1, #p, if(p[i]%3 == 0, 0, if(p[i]%3 == 1, -1, 1)));}

Formula

Additive with a(p^e) = 0 if p = 3, 1 if p == 2 (mod 3), and -1 if p == 1 (mod 3).
a(n) = A005090(n) - A005088(n).
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = A086241 = 0.641944... .
Showing 1-8 of 8 results.