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

A072591 In prime factorization of n replace multiplication with bitwise logical 'and'.

Original entry on oeis.org

1, 2, 3, 2, 5, 2, 7, 2, 3, 0, 11, 2, 13, 2, 1, 2, 17, 2, 19, 0, 3, 2, 23, 2, 5, 0, 3, 2, 29, 0, 31, 2, 3, 0, 5, 2, 37, 2, 1, 0, 41, 2, 43, 2, 1, 2, 47, 2, 7, 0, 1, 0, 53, 2, 1, 2, 3, 0, 59, 0, 61, 2, 3, 2, 5, 2, 67, 0, 3, 0, 71, 2, 73, 0, 1, 2, 3, 0, 79, 0, 3, 0, 83, 2, 1, 2, 1, 2, 89, 0, 5, 2, 3, 2
Offset: 1

Views

Author

Reinhard Zumkeller, Jun 23 2002

Keywords

Comments

a(n) = a(A007947(n)); n is prime iff a(n)=n;
a(n)=0 iff n is even and one prime factor is of form 4*k+1.

Examples

			a(35) = a(5*7) = a(5) 'and' a(7) = '101' and '111' = '101' = 5.
		

Crossrefs

Programs

  • Haskell
    import Data.Bits ((.&.))
    a072591 = foldl1 (.&.) . a027746_row  -- Reinhard Zumkeller, Jul 05 2013
    
  • Mathematica
    a[n_] := BitAnd @@ FactorInteger[n][[All, 1]];
    Array[a, 100] (* Jean-François Alcover, Nov 16 2021 *)
  • Python
    from sympy import factorint
    from operator import _and_
    from functools import reduce
    def a(n): return reduce(_and_, (f for f in factorint(n))) if n > 1 else 1
    print([a(n) for n in range(1, 95)]) # Michael S. Branicky, May 31 2025

A235050 Squarefree numbers such that none of their prime factors share common 1-bits in the same bit-position of their binary representations.

Original entry on oeis.org

1, 2, 3, 5, 7, 10, 11, 13, 17, 19, 23, 26, 29, 31, 34, 37, 41, 43, 47, 53, 58, 59, 61, 67, 71, 73, 74, 79, 82, 83, 89, 97, 101, 103, 106, 107, 109, 113, 122, 127, 131, 137, 139, 146, 149, 151, 157, 163, 167, 173, 178, 179, 181, 191, 193, 194, 197, 199, 202, 211, 218, 223, 226, 227, 229, 233, 239, 241, 251, 257
Offset: 1

Views

Author

Antti Karttunen, Jan 22 2014

Keywords

Comments

a(1)=1 is included on the grounds that it has no prime factors at all, thus no conflicting 1-bits.
After a(1)=1 all n such that A001414(n) = A072593(n), or equally, A001414(n) = A072594(n).
Union of noncomposites (A008578) and semiprimes of the form 2*A002144 (cf. also A235490).

Crossrefs

Subsequences: A000040, A235490.
Subsequence of A005117.

A235490 Numbers such that none of their prime factors share common 1-bits in the same bit-position and when added (or "ored" or "xored") together, yield a term of A000225 (a binary "repunit").

Original entry on oeis.org

1, 3, 7, 10, 26, 31, 58, 122, 127, 1018, 2042, 8186, 8191, 32762, 131071, 524287, 2097146, 8388602, 33554426, 1073741818, 2147483647, 2305843009213693951, 618970019642690137449562111, 39614081257132168796771975162, 162259276829213363391578010288127, 166153499473114484112975882535043066
Offset: 1

Views

Author

Antti Karttunen, Jan 22 2014

Keywords

Comments

a(1) = 1 is included on the grounds that it has no prime factors, thus A001414(1)=0, and 0 is one of the terms of A000225, marking the "repunit of length zero".
After 1, the sequence is a union of A000668 (Mersenne primes) and semiprimes of the form 2*A050415. The terms were constructed from the data given in those two entries.

Examples

			7 is included, because it is a prime, and repunit in base-2: '111'.
10 is included, as 10=2*5, and when we add 2 ('10' in binary) and 5 ('101' in binary), we also get 7 ('111' in binary), without producing any carries.
		

Crossrefs

Showing 1-4 of 4 results.