[go: up one dir, main page]

login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A087991 revision #23

A087991
Number of non-palindromic divisors of n.
12
0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 0, 1, 2, 1, 2, 1, 2, 1, 3, 1, 2, 0, 2, 1, 3, 1, 2, 2, 3, 1, 3, 1, 0, 2, 2, 1, 4, 1, 3, 2, 3, 1, 3, 0, 3, 2, 2, 1, 6, 1, 2, 2, 3, 2, 0, 1, 3, 2, 4, 1, 5, 1, 2, 3, 3, 0, 4, 1, 5, 2, 2, 1, 6, 2, 2, 2, 0, 1, 6, 2, 3, 2, 2, 2, 6, 1, 3, 0, 5, 0, 4, 1, 4, 4
OFFSET
1,20
LINKS
FORMULA
a(n) = A000005(n) - A087990(n).
EXAMPLE
n=132: divisors={1,2,3,4,6,11,12,22,33,44,66,132},
revdivisors={1,2,3,4,6,11,21,22,33,44,66,231}, a[132]=2;
so two of 12 divisors of n are non-palindromic:{21,132}.
MATHEMATICA
palQ[n_] := Reverse[x = IntegerDigits[n]] == x; Table[Count[Divisors[n], _?(! palQ[#] &)], {n, 105}] (* Jayanta Basu, Aug 10 2013 *)
PROG
(Python)
def ispal(n):
w=str(n)
return w==w[::-1]
def A087991(n):
s = 0
for i in range(1, n+1):
if n%i==0 and not ispal(i):
s+=1
return s
print([A087991(n) for n in range(1, 60)]) # Indranil Ghosh, Feb 10 2017
CROSSREFS
Sequence in context: A333590 A263233 A300623 * A335451 A366078 A344652
KEYWORD
nonn,base
AUTHOR
Labos Elemer, Oct 08 2003
STATUS
editing