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.

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

A072593 In prime factorization of n replace multiplication with bitwise logical 'or'.

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Jun 23 2002

Keywords

Comments

a(n) = a(A007947(n)); n is prime iff a(n)=n.

Examples

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

Crossrefs

Programs

  • Haskell
    import Data.Bits (((.|.))
    a072593 = foldl1 (.|.) . a027746_row  -- Reinhard Zumkeller, Jul 05 2013
    
  • Mathematica
    Array[BitOr @@ Flatten[ConstantArray[#1, #2] & @@@ FactorInteger[#]] &, 120] (* Michael De Vlieger, May 31 2025 *)
  • PARI
    a072593(n) = if(n<2, return(1)); my(F=factor(n), v=Vec(F[,1]), x=v[1]); for(k=2, #v, x=bitor(x,v[k])); x \\ Hugo Pfoertner, May 31 2025
    
  • Python
    from sympy import factorint
    from operator import _or_
    from functools import reduce
    def a(n): return reduce(_or_, (f for f in factorint(n))) if n > 1 else 1
    print([a(n) for n in range(1, 84)]) # Michael S. Branicky, May 31 2025

A072592 Even numbers with at least one prime factor of form 4*k+1.

Original entry on oeis.org

10, 20, 26, 30, 34, 40, 50, 52, 58, 60, 68, 70, 74, 78, 80, 82, 90, 100, 102, 104, 106, 110, 116, 120, 122, 130, 136, 140, 146, 148, 150, 156, 160, 164, 170, 174, 178, 180, 182, 190, 194, 200, 202, 204, 208, 210, 212, 218, 220, 222, 226, 230, 232, 234, 238
Offset: 1

Views

Author

Reinhard Zumkeller, Jun 23 2002

Keywords

Comments

Conjecture: this is exactly the sequence whose terms are twice those of A009003. (This has been verified for all terms<=500.) Compare A009003. - John W. Layman, Mar 12 2008
The conjecture is true. See comments on A008846 and A004613. - Lambert Herrgesell (zero815(AT)googlemail.com), Apr 24 2008

Crossrefs

Programs

Formula

A072591(a(n)) = 0.
Showing 1-3 of 3 results.