|
|
A175242
|
|
a(n) = the number of divisors of n that are palindromes when written in binary.
|
|
3
|
|
|
1, 1, 2, 1, 2, 2, 2, 1, 3, 2, 1, 2, 1, 2, 4, 1, 2, 3, 1, 2, 4, 1, 1, 2, 2, 1, 4, 2, 1, 4, 2, 1, 3, 2, 3, 3, 1, 1, 2, 2, 1, 4, 1, 1, 6, 1, 1, 2, 2, 2, 4, 1, 1, 4, 2, 2, 2, 1, 1, 4, 1, 2, 6, 1, 3, 3, 1, 2, 2, 3, 1, 3, 2, 1, 4, 1, 2, 2, 1, 2, 4, 1, 1, 4, 4, 1, 2, 1, 1, 6, 2, 1, 4, 1, 2, 2, 1, 2, 5, 2, 1, 4, 1, 1, 6
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,3
|
|
LINKS
|
|
|
FORMULA
|
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = A244162 = 2.378795... . - Amiram Eldar, Jan 01 2024
|
|
EXAMPLE
|
a(3) = 2 since 3 has 2 divisors, 1 and 3, that are palindromes when written in binary: 1 and 11.
|
|
MAPLE
|
a:= n-> add(`if`(l=ListTools[Reverse](l), 1, 0), l=
map(Bits[Split], numtheory[divisors](n))):
|
|
MATHEMATICA
|
palbQ[n_]:=Module[{idn2=IntegerDigits[n, 2]}, idn2==Reverse[idn2]]; Table[ Count[ Divisors[ n], _?(palbQ[#]&)], {n, 110}] (* Harvey P. Dale, Mar 27 2019 *)
a[n_] := DivisorSum[n, 1 &, PalindromeQ @ IntegerDigits[#, 2] &]; Array[a, 100] (* Amiram Eldar, Jan 01 2020 *)
|
|
PROG
|
(PARI) is(n) = my(d=binary(n)); d==Vecrev(d); \\ A006995
(Python)
from sympy import divisors
def c(n): b = bin(n)[2:]; return b == b[::-1]
def a(n): return sum(1 for d in divisors(n, generator=True) if c(d))
|
|
CROSSREFS
|
|
|
KEYWORD
|
base,nonn
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|