A235342 Sum of exponents in the (unique) factorization of n as a ratio of p! terms, p prime.
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
Offset: 1
Keywords
Examples
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!).
Links
- Antti Karttunen, Table of n, a(n) for n = 1..5040
- Seventieth Annual William Lowell Putnam Mathematical Competition, Problem B1, (2009).
Programs
-
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()
Formula
a(1)=0; a(p!)=1, p prime; a(xy)=a(x)+a(y); (group homomorphism from Q^+ to Z).
Extensions
More terms from Antti Karttunen, Mar 28 2017
Comments