login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A248663 a(1) = 0; a(A000040(n)) = 2^(n-1), and a(n*m) = a(n) XOR a(m). 26
0, 1, 2, 0, 4, 3, 8, 1, 0, 5, 16, 2, 32, 9, 6, 0, 64, 1, 128, 4, 10, 17, 256, 3, 0, 33, 2, 8, 512, 7, 1024, 1, 18, 65, 12, 0, 2048, 129, 34, 5, 4096, 11, 8192, 16, 4, 257, 16384, 2, 0, 1, 66, 32, 32768, 3, 20, 9, 130, 513, 65536, 6, 131072, 1025, 8, 0, 36, 19 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,3

COMMENTS

a(k^2) = 0 for a natural number k.

a(x*y) = a(x) XOR a(y) where XOR is the bitwise exclusive or operation (A003987).

The binary digits of a(n) encode the prime factorization of A007913(n), where the i-th digit from the right is 1 iff prime(i) divides A007913(n), otherwise 0. - Robert Israel, Jan 12 2015

Equivalently, the i-th binary digit from the right is 1 iff prime(i) divides n an odd number of times, otherwise zero. - Ethan Beihl, Oct 15 2016

When a polynomial with nonnegative integer coefficients is encoded with the prime factorization of n (e.g., as in A206296, A260443), then A048675(n) gives the evaluation of that polynomial at x=2. This sequence is otherwise similar, except the polynomial is evaluated over the field GF(2), which implies also that all its coefficients are essentially reduced modulo 2. - Antti Karttunen, Dec 11 2015

Squarefree numbers (A005117) give the positions k where a(k) = A048675(k). - Antti Karttunen, Oct 29 2016

LINKS

Peter Kagey, Table of n, a(n) for n = 1..5000

FORMULA

a(1) = 0; for n > 1, if n is a prime, a(n) = 2^(A000720(n)-1), otherwise a(A020639(n)) XOR a(A032742(n)). [After the definition.] - Antti Karttunen, Dec 11 2015

For n > 1, this simplifies to: a(n) = 2^(A055396(n)-1) XOR a(A032742(n)). [Where A055396(n) gives the index of the smallest prime dividing n and A032742(n) gives the largest proper divisor of n. Cf. a similar formula for A048675.]

Other identities and observations. For all n >= 0:

a(n) = A048672(A100112(A007913(n))). - Peter Kagey, Dec 10 2015

From Antti Karttunen, Dec 11 2015, Sep 19 & Oct 27 2016: (Start)

a(n) = a(A007913(n)). [The result depends only on the squarefree part of n.]

a(n) = A048675(A007913(n)).

a(A206296(n)) = A168081(n).

a(A260443(n)) = A264977(n).

a(A265408(n)) = A265407(n).

a(A275734(n)) = A275808(n).

a(A276076(n)) = A276074(n).

(End)

EXAMPLE

a(3500) = a(2^2 * 5^3 * 7) = a(2) XOR a(2) XOR a(5) XOR a(5) XOR a(5) XOR a(7) = 1 XOR 1 XOR 4 XOR 4 XOR 4 XOR 8 = 0b0100 XOR 0b1000 = 0b1100 = 12.

MAPLE

f:= proc(n)

local F, f;

F:= select(t -> t[2]::odd, ifactors(n)[2]);

add(2^(numtheory:-pi(f[1])-1), f = F)

end proc:

seq(f(i), i=1..100); # Robert Israel, Jan 12 2015

MATHEMATICA

a[1] = 0; a[n_] := a[n] = If[PrimeQ@ n, 2^(PrimePi@ n - 1), BitXor[a[#], a[n/#]] &@ FactorInteger[n][[1, 1]]]; Array[a, 66] (* Michael De Vlieger, Sep 16 2016 *)

PROG

(Ruby)

require 'prime'

def f(n)

  a = 0

  reverse_primes = Prime.each(n).to_a.reverse

  reverse_primes.each do |prime|

    a <<= 1

    while n % prime == 0

      n /= prime

      a ^= 1

    end

  end

  a

end

(Scheme, with memoizing-macro definec)

(definec (A248663 n) (cond ((= 1 n) 0) ((= 1 (A010051 n)) (A000079 (- (A000720 n) 1))) (else (A003987bi (A248663 (A020639 n)) (A248663 (A032742 n)))))) ;; Where A003987bi computes bitwise-XOR as in A003987.

;; Alternatively:

(definec (A248663 n) (cond ((= 1 n) 0) (else (A003987bi (A000079 (- (A055396 n) 1)) (A248663 (A032742 n))))))

;; Antti Karttunen, Dec 11 2015

(Haskell)

import Data.Bits (xor)

a248663 = foldr (xor) 0 . map (\i -> 2^(i - 1)) . a112798_row

-- Peter Kagey, Sep 16 2016

(Python)

from sympy import factorint, primepi

from sympy.ntheory.factor_ import core

def a048675(n):

    f=factorint(n)

    return 0 if n==1 else sum([f[i]*2**(primepi(i) - 1) for i in f])

def a(n): return a048675(core(n)) print [a(n) for n in xrange(1, 101)] # Indranil Ghosh, Jun 21 2017

CROSSREFS

Cf. A000040, A000079, A000720, A003987, A005117, A007913, A020639, A032742, A048672, A048675, A055396, A100112.

Cf. also A099884, A168081, A206296, A260443, A264977, A265407, A265408, A275734, A275808, A276074, A276076, A277330.

A087207 is the analogous sequence with OR.

A277417 gives the positions where coincides with A277333.

A000290 gives the positions of zeros.

Sequence in context: A243488 A154849 A277333 * A093443 A099092 A177806

Adjacent sequences:  A248660 A248661 A248662 * A248664 A248665 A248666

KEYWORD

nonn,base

AUTHOR

Peter Kagey, Jan 11 2015

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified June 16 12:38 EDT 2019. Contains 324152 sequences. (Running on oeis4.)