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

A072594 In prime factorization of n replace multiplication with bitwise logical 'xor'.

Original entry on oeis.org

1, 2, 3, 0, 5, 1, 7, 2, 0, 7, 11, 3, 13, 5, 6, 0, 17, 2, 19, 5, 4, 9, 23, 1, 0, 15, 3, 7, 29, 4, 31, 2, 8, 19, 2, 0, 37, 17, 14, 7, 41, 6, 43, 11, 5, 21, 47, 3, 0, 2, 18, 13, 53, 1, 14, 5, 16, 31, 59, 6, 61, 29, 7, 0, 8, 10, 67, 17, 20, 0, 71, 2, 73, 39, 3, 19, 12, 12, 79, 5, 0, 43, 83, 4
Offset: 1

Views

Author

Reinhard Zumkeller, Jun 23 2002

Keywords

Comments

n is prime iff a(n)=n;
for primes p, k>0: a(p^k)=p*(k mod 2);
for m>1: a(m^2)=0, see A072595.
a(A127812(n)) = n and a(m) <> n for m < A127812(n).

Examples

			a(35) = a(5*7) = a(5) 'xor' a(7) = '101' xor '111' = '010' = 2.
		

Crossrefs

Programs

  • Haskell
    import Data.Bits (xor)
    a072594 = foldl1 xor . a027746_row :: Integer -> Integer
    -- Reinhard Zumkeller, Nov 17 2012
    
  • Mathematica
    a[n_] := BitXor @@ Flatten[ Table[ First[#], {Last[#]} ]& /@ FactorInteger[n] ]; Table[a[n], {n, 1, 84}] (* Jean-François Alcover, Mar 11 2013 *)
  • PARI
    a(n)=if(n==1, return(1)); my(f=factor(n),t); for(i=1,#f~, if(f[i,2]%2, t=bitxor(t,f[i,1]))); t \\ Charles R Greathouse IV, Aug 28 2016
    
  • Python
    from sympy import factorint
    from operator import _xor_
    from functools import reduce
    def a(n): return reduce(_xor_, (f for f in factorint(n, multiple=True))) if n > 1 else 1
    print([a(n) for n in range(1, 85)]) # Michael S. Branicky, May 31 2025

A235488 Squarefree numbers which yield zero when their prime factors are xored together.

Original entry on oeis.org

70, 646, 1798, 2145, 3526, 5865, 6006, 9177, 11305, 13110, 16422, 20553, 20806, 21489, 23529, 28905, 28985, 30305, 31465, 37961, 38086, 38454, 42441, 44022, 44998, 45353, 45942, 46345, 53985, 54230, 55913, 60630, 60697, 61705, 62049, 64790, 78406, 80934, 81158
Offset: 1

Views

Author

Antti Karttunen, Jan 22 2014

Keywords

Comments

All n for which A008683(n) <> 0 and A072594(n) = 0.
It seems that an analogous case as A072595 for GF(2)[X]-polynomials is just the squares of GF(2)[X]-polynomials (A000695), thus in that ring, the sequence analogous to this one would be empty.
This sequence happens also to encode in the prime factorization of n a certain subset of the Nim game positions that are second-player win.

Examples

			70 is included, as 70 = 2*5*7, whose binary representations are '10', '101' and '111', which when all are xored (cf. A003987) together, cancel all 1-bits, thus yielding zero.
212585 is included, as 212585 = 5*17*41*61, and when we xor their base-2 representations together:
     101
   10001
  101001
  111101
--------
  000000
we get only zeros, because in each column (bit-position), there is an even number of 1-bits.
		

Crossrefs

Intersection of A005117 and A072595 (equally: of A005117 and A072596).

Programs

  • Mathematica
    Select[Range[82000],SquareFreeQ[#]&&BitXor@@FactorInteger[#][[All,1]]==0&] (* Harvey P. Dale, Apr 01 2017 *)
  • PARI
    is(n)=if(n<9, return(0)); my(f=factor(n)); vecmax(f[,2])==1 && fold(bitxor, f[,1])==0 \\ Charles R Greathouse IV, Aug 06 2016

A260737 Sum of Hamming distances between binary representations of prime factors of n, summed over all nonordered pairs of primes present (with multiplicity) in the prime factorization of n.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Sep 22 2015

Keywords

Examples

			For n = 1 the prime factorization is empty, thus there is nothing to sum, so a(1) = 0.
For n = 6 = 2*3, a(6) = 1 because the Hamming distance between 2 and 3 is 1 as 2 = "10" in binary and 3 = "11" in binary.
For n = 10 = 2*5, a(10) = 3 because the Hamming distance between 2 and 5 is 3 as 2 = "10" in binary (extended with a leading zero to make it "010") and 5 = "101" in binary.
For n = 12 = 2*2*3, a(12) = 2 because the Hamming distance between 2 and 3 is 1, and the pair (2,3) occurs twice as one can pick either one of the two 2's present in the prime factorization to be a pair of a single 3. Note that the Hamming distance between 2 and 2 is 0, thus the pair (2,2) of prime divisors does not contribute to the sum.
For n = 36 = 2*2*3*3, a(36) = 4 because the Hamming distance between 2 and 3 is 1, and the prime factor pair (2,3) occurs four times in total. Note that the Hamming distance is zero between 2 and 2 as well as between 3 and 3, thus the pairs (2,2) and (3,3) do not contribute to the sum.
		

Crossrefs

Cf. A101080.
Cf. A000961 (positions of the zeros), A261077 (positions of the ones).
Cf. also A261079.

A072596 Nonsquares with A072594(n) = 0.

Original entry on oeis.org

70, 280, 630, 646, 1120, 1750, 1798, 2145, 2520, 2584, 3430, 3526, 4480, 5670, 5814, 5865, 6006, 7000, 7192, 8470, 8580, 9177, 10080, 10336, 11305, 11830, 13110, 13720, 14104, 15750, 16150, 16182, 16422, 17920, 19305, 20230, 20553, 20806
Offset: 1

Views

Author

Reinhard Zumkeller, Jun 23 2002

Keywords

Comments

A010052(a(n)) = 0. - Reinhard Zumkeller, Nov 17 2012

Crossrefs

Cf. A072595.

Programs

  • Haskell
    a072596 n = a072596_list !! (n-1)
    a072596_list = filter ((== 0) . a010052) a072595_list
    -- Reinhard Zumkeller, Nov 17 2012
    
  • PARI
    is(n)=if(issquare(n), return(0)); my(f=factor(n), t); for(i=1, #f~, if(f[i, 2]%2, t=bitxor(t, f[i, 1]))); t==0 \\ Charles R Greathouse IV, Aug 28 2016
Showing 1-4 of 4 results.