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

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A235342 Sum of exponents in the (unique) factorization of n as a ratio of p! terms, p prime. 2
0, 1, 0, 2, -2, 1, -1, 3, 0, -1, -2, 2, -2, 0, -2, 4, -2, 1, -1, 0, -1, -1, 2, 3, -4, -1, 0, 1, 1, -1, 1, 5, -2, -1, -3, 2, -1, 0, -2, 1, 1, 0, 0, 0, -2, 3, -1, 4, -2, -3, -2, 0, 3, 1, -4, 2, -1, 2, 0, 0, 0, 2, -1, 6, -4, -1, -2, 0, 2, -2, 0, 3, -3, 0, -4, 1, -3, -1, 7, 2, 0, 2, -4, 1, -4, 1, 1, 1, 0, -1, -3, 4, 1, 0, -3, 5, -3, -1, -2, -2, 5, -1, 1 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,4

COMMENTS

With n>0, write n=p_1!p_2!...p_k!/(q_1!q2!...q_l!) where p_i,q_j are primes and the fraction is simplified (ie., no p_i is a q_j).  This representation is unique for positive integers (and positive rational numbers), so we let a(n):=#p_i! terms on top-#q_j! terms on bottom.

LINKS

Antti Karttunen, Table of n, a(n) for n = 1..5040

Problem B1, Seventieth Annual William Lowell Putnam Mathematical Competition (2009)

FORMULA

a(1)=0; a(p!)=1, p prime; a(xy)=a(x)+a(y); (group homomorphism from Q^+ to Z).

EXAMPLE

a(1)=0 (by convention).

a(2)=1 since 2=2!.

a(3)=0 since 3=3!/2!.

a(4)=2 since 4=2!*2!.

a(5)=-2 since 5=5!/(3!*2!*2!).

PROG

(Sage)

def plus(c, d, mult):

  for elt in d:

    if elt in c:

      c[elt]+=mult*d[elt]

    else:

      c[elt]=mult*d[elt]

def rep(m):

  if m==1:

    return {}

  if m==2:

    return {2:1}

  f=factor(Integer(m))

  #print f

  if len(f)==1 and f[0][1]==1:

    #print "prime", m

    p=prime_range(m)[-1]

    new={m:1, p:-1}

    r=range(p+1, m)

    #print "range", r

    for k in r:

      plus(new, rep(k), -1)

  else:

    new={}

    #print "not prime", m, f

    for (p, mult) in f:

      #print (p, mult)

      plus(new, rep(p), mult)

  for elt in [elt for elt in new if new[elt]==0]:

    new.pop(elt)

  return new

def weight(m):

  w=0

  r=rep(m)

  for p in r:

    w+=r[p]

  return w

A235342=[weight(m) for m in range(1, 5041)]

# Above code "de-periodicized" by Antti Karttunen, Mar 28 2017

# This is just for outputting a b-file:

i=0

outfp = open('b235342.txt', 'w')

for an in A235342:

    i = i+1

    outfp.write(str(i) + " " + str(an) + "\n")

outfp.close()

CROSSREFS

Cf. A001222, A236441.

Sequence in context: A244006 A110283 A226290 * A079692 A110269 A238280

Adjacent sequences:  A235339 A235340 A235341 * A235343 A235344 A235345

KEYWORD

sign

AUTHOR

Alexander Riasanovsky, Jan 06 2014

EXTENSIONS

More terms and b-file computed with the given Sage-program by Antti Karttunen, Mar 28 2017

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 September 22 12:19 EDT 2019. Contains 327307 sequences. (Running on oeis4.)