Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
A280827
a(n) = A076649(n) - A055642(n).
3
-1, 0, 0, 1, 0, 1, 0, 2, 1, 0, 0, 1, 0, 0, 0, 2, 0, 1, 0, 1, 0, 1, 0, 2, 0, 1, 1, 1, 0, 1, 0, 3, 1, 1, 0, 2, 0, 1, 1, 2, 0, 1, 0, 2, 1, 1, 0, 3, 0, 1, 1, 2, 0, 2, 1, 2, 1, 1, 0, 2, 0, 1, 1, 4, 1, 2, 0, 2, 1, 1, 0, 3, 0, 1, 1, 2, 1, 2, 0, 3, 2, 1, 0, 2, 1, 1, 1, 3, 0, 2, 1, 2, 1, 1, 1, 4, 0, 1, 2, 1
OFFSET
1,8
COMMENTS
a(1) is the only negative term in this sequence. - Ely Golden, Jan 10 2017
a(n) = 0 if and only if n is a member of A109608. - Ely Golden, Jan 10 2017
EXAMPLE
a(10) = 0, as 2*5 have 2 digits total, and 10 has 2 digits. Thus a(10) = 2-2 = 0.
a(1) is defined to be -1, as the empty product has 0 digits, and 1 has 1 digit. Thus a(1) = 0-1 = -1.
PROG
(SageMath)
def digits(x, n):
if(x<=0|n<2):
return []
li=[]
while(x>0):
d=divmod(x, n)
li.insert(0, d[1])
x=d[0]
return li;
def factorDigits(x, n):
if(x<=0|n<2):
return []
li=[]
f=list(factor(x))
for c in range(len(f)):
for d in range(f[c][1]):
ld=digits(f[c][0], n)
li+=ld
return li;
def digitDiff(x, n):
return len(factorDigits(x, n))-len(digits(x, n))
radix=10
index=1
while(index<=10000):
print(str(index)+" "+str(digitDiff(index, radix)))
index+=1
CROSSREFS
Sequence in context: A336352 A081221 A366988 * A103840 A066301 A046660
KEYWORD
sign,base,easy
AUTHOR
Ely Golden, Jan 08 2017
STATUS
approved