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

A267116 Bitwise-OR of the exponents of primes in the prime factorization of n.

Original entry on oeis.org

0, 1, 1, 2, 1, 1, 1, 3, 2, 1, 1, 3, 1, 1, 1, 4, 1, 3, 1, 3, 1, 1, 1, 3, 2, 1, 3, 3, 1, 1, 1, 5, 1, 1, 1, 2, 1, 1, 1, 3, 1, 1, 1, 3, 3, 1, 1, 5, 2, 3, 1, 3, 1, 3, 1, 3, 1, 1, 1, 3, 1, 1, 3, 6, 1, 1, 1, 3, 1, 1, 1, 3, 1, 1, 3, 3, 1, 1, 1, 5, 4, 1, 1, 3, 1, 1, 1, 3, 1, 3, 1, 3, 1, 1, 1, 5, 1, 3, 3, 2, 1, 1, 1, 3, 1, 1, 1, 3, 1, 1, 1, 5, 1, 1, 1, 3, 3, 1, 1, 3
Offset: 1

Views

Author

Antti Karttunen, Feb 03 2016

Keywords

Examples

			For n = 4 = 2^2, bitwise-OR of 2 alone is 2, thus a(4) = 2.
For n = 6 = 2^1 * 3^1, when we take a bitwise-or of 1 and 1, we get 1, thus a(6) = 1.
For n = 24 = 2^3 * 3^1, bitwise-or of 3 and 1 ("11" and "01" in binary) gives "11", thus a(24) = 3.
For n = 210 = 2^1 * 3^1 * 5^1 * 7^1, bitwise-or of 1, 1, 1 and 1 gives 1, thus a(210) = 1.
For n = 720 = 2^4 * 3^2 * 5^1, bitwise-or of 4, 2 and 1 ("100", "10" and "1" in binary) gives 7 ("111" in binary), thus a(720) = 7.
		

Crossrefs

Cf. A000290 (indices of even numbers).
Cf. A000037 (indices of odd numbers).
Nonunit terms of A005117, A062503, A113849 give the positions of ones, twos, fours respectively in this sequence.
Sequences with similar definitions: A260728, A267113, A267115 (bitwise-AND) and A268387 (bitwise-XOR of exponents).
Sequences with related analysis: A267114, A268374, A268375, A268376.
Sequences A088529, A136565 and A181591 coincide with a(n) for n: 2 <= n < 24.
A003961, A059896 are used to express relationship between terms of this sequence.
Related to A087207 via A225546.

Programs

  • Maple
    read("transforms"):
    A267116 := proc(n)
        local a,e ;
        a := 0 ;
        for e in ifactors(n)[2] do
            a := ORnos(a,op(2,e)) ;
        end do:
        a ;
    end proc: # R. J. Mathar, Feb 16 2021
  • Mathematica
    {0}~Join~Rest@ Array[BitOr @@ Map[Last, FactorInteger@ #] &, 120] (* Michael De Vlieger, Feb 04 2016 *)
  • PARI
    a(n)=my(f = factor(n)); my(b = 0); for (k=1, #f~, b = bitor(b, f[k,2]);); b; \\ Michel Marcus, Feb 05 2016
    
  • PARI
    a(n)=if(n>1, fold(bitor, factor(n)[,2]), 0) \\ Charles R Greathouse IV, Aug 04 2016
    
  • Python
    from functools import reduce
    from operator import or_
    from sympy import factorint
    def A267116(n): return reduce(or_,factorint(n).values(),0) # Chai Wah Wu, Aug 31 2022

Formula

a(1) = 0; for n > 1: a(n) = A067029(n) OR a(A028234(n)). [Here OR stands for bitwise-or, A003986.]
Other identities and observations. For all n >= 1:
a(n) = A007814(n) OR A260728(n) OR A267113(n).
a(n) = A001222(n) - A268374(n).
A268387(n) <= a(n) <= A001222(n).
From Peter Munn, Jan 08 2020: (Start)
a(A059896(n,k)) = a(n) OR a(k).
a(A003961(n)) = a(n).
a(n^2) = 2*a(n).
a(n) = A087207(A225546(n)).
a(A225546(n)) = A087207(n).
(End)

A260728 Bitwise-OR of the exponents of all 4k+3 primes in the prime factorization of n.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Aug 12 2015

Keywords

Comments

A001481 (numbers that are the sum of 2 squares) gives the positions of even terms in this sequence, while its complement A022544 (numbers that are not the sum of 2 squares) gives the positions of odd terms.
If instead of bitwise-oring (A003986) we added in ordinary way the exponents of 4k+3 primes together, we would get the sequence A065339. For the positions where these two sequences differ see A260730.

Examples

			For n = 21 = 3^1 * 7^1 we compute A003986(1,1) = 1, thus a(21) = 1.
For n = 63 = 3^2 * 7^1 we compute A003986(2,1) = A003986(1,2) = 3, thus a(63) = 3.
		

Crossrefs

Cf. also A267113, A267116, A267099.
Differs from A065339 for the first time at n=21, where a(21) = 1, while A065339(21)=2.

Programs

Formula

If n < 3, a(n) = 0; thereafter, for any even n: a(n) = a(n/2), for any n with its smallest prime factor (A020639) of the form 4k+1: a(n) = a(A032742(n)), otherwise [when A020639(n) is of the form 4k+3] a(n) = A003986(A067029(n),a(A028234(n))).
Other identities. For all n >= 0:
A229062(n) = 1 - A000035(a(n)). [Reduced modulo 2 and complemented, the sequence gives the characteristic function of A001481.]
a(n) = a(A097706(n)). [The result depends only on the prime factors of the form 4k+3.]
a(n) = A267116(A097706(n)).
a(n) = A267113(A267099(n)).

A286361 Least number with the same prime signature as {the largest divisor of n with only prime factors of the form 4k+1} has: a(n) = A046523(A170818(n)).

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 1, 1, 1, 2, 1, 1, 2, 1, 2, 1, 2, 1, 1, 2, 1, 1, 1, 1, 4, 2, 1, 1, 2, 2, 1, 1, 1, 2, 2, 1, 2, 1, 2, 2, 2, 1, 1, 1, 2, 1, 1, 1, 1, 4, 2, 2, 2, 1, 2, 1, 1, 2, 1, 2, 2, 1, 1, 1, 6, 1, 1, 2, 1, 2, 1, 1, 2, 2, 4, 1, 1, 2, 1, 2, 1, 2, 1, 1, 6, 1, 2, 1, 2, 2, 2, 1, 1, 1, 2, 1, 2, 1, 1, 4, 2, 2, 1, 2, 2, 2, 1, 1, 2, 2, 2, 1, 2, 1, 2, 2, 2, 1, 2, 2
Offset: 1

Views

Author

Antti Karttunen, May 08 2017

Keywords

Crossrefs

Differs from A063014 for the first time at n=25, where a(25) = 4, while A063014(25) = 3.

Programs

  • Python
    from sympy import factorint
    from operator import mul
    def P(n):
        f = factorint(n)
        return sorted([f[i] for i in f])
    def a046523(n):
        x=1
        while True:
            if P(n) == P(x): return x
            else: x+=1
    def a072438(n):
        f = factorint(n)
        return 1 if n == 1 else reduce(mul, [1 if i%4==1 else i**f[i] for i in f])
    def a(n): return a046523(n/a072438(n)) # Indranil Ghosh, May 09 2017
  • Scheme
    (define (A286361 n) (A046523 (A170818 n)))
    

Formula

a(n) = A046523(A170818(n)).
a(n) = A286363(A267099(n)).

A268377 Numbers n such that any prime factor of the form 4k+1 has even multiplicity.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Feb 03 2016

Keywords

Comments

Closed under multiplication.

Examples

			Neither 5 or 10 (= 2*5) are included, because the prime factor 5 (of the form 4k+1) occurs just once.
6 = 2*3 is present, as there are no prime factors of 4k+1 present at all, and zero is an even number.
Also 25 (5*5) and 50 (2*5*5) and 75 (3*5*5) and 625 (5*5*5*5) are included, because in all of them, the prime factor 5 (of the form 4k+1) occurs an even number of times.
		

Crossrefs

Cf. A267113.
Cf. A268378 (a subsequence).

Programs

  • Mathematica
    {1}~Join~Select[Range@ 140, NoneTrue[FactorInteger@ #, And[Mod[First@ #, 4] == 1, OddQ@ Last@ #] &] &] (* Michael De Vlieger, Feb 04 2016, Version 10 *)
  • PARI
    isok(n) = {my(f = factor(n)); for (i=1, #f~, if (((f[i,1] % 4) == 1) && (f[i,2] % 2), return (0));); return (1);} \\ Michel Marcus, Feb 04 2016
  • Scheme
    (define A268377 (MATCHING-POS 1 1 (COMPOSE even? A267113)))
    

A268378 Numbers whose prime factorization includes at least one prime factor of form 4k+3 and any prime factor of the form 4k+1 has even multiplicity.

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, 75, 76, 77, 79, 81, 83, 84, 86, 88, 92, 93, 94, 96, 98, 99, 103, 107, 108, 112, 114, 118, 121, 124, 126, 127, 129, 131, 132, 133, 134, 138, 139, 141, 142, 144, 147, 150
Offset: 1

Views

Author

Antti Karttunen, Feb 03 2016

Keywords

Comments

Closed under multiplication.

Examples

			6 = 2*3 is included, as there is a prime factor of the form 4k+3 present.
75 = 3 * 5 * 5 is included, as there is a prime factor of the form 4k+3 present and the prime factor of the form 4k+1 (5) is present twice.
		

Crossrefs

Subsequence of A268377.
Differs from A221264 for the first time at n=38, which here is a(38) = 75, a value missing from A221264.

Programs

  • Mathematica
    Select[Range@ 150, AnyTrue[#, Mod[First@ #, 4] == 3 &] && NoneTrue[#, And[Mod[First@ #, 4] == 1, OddQ@ Last@ #] &] &@ FactorInteger@ # &] (* Michael De Vlieger, Feb 04 2016, Version 10 *)
  • PARI
    isok(n) = {my(f = factor(n), nb3 = 0); for (i=1, #f~, if (((f[i,1] % 4) == 1) && (f[i,2] % 2), return (0)); if ((f[i,1] % 4) == 3, nb3++);); return (nb3);} \\ Michel Marcus, Feb 04 2016
Showing 1-5 of 5 results.