A072593 In prime factorization of n replace multiplication with bitwise logical 'or'.
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
Keywords
Examples
a(35) = a(5*7) = a(5) 'or' a(7) = '101' or '111' = '111' = 7.
Links
- Paul Tek, Table of n, a(n) for n = 1..10000
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
Comments