cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A175242 a(n) = the number of divisors of n that are palindromes when written in binary.

This page as a plain text file.
%I A175242 #26 Jan 01 2024 07:59:24
%S A175242 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,
%T A175242 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,
%U A175242 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
%N A175242 a(n) = the number of divisors of n that are palindromes when written in binary.
%H A175242 Amiram Eldar, <a href="/A175242/b175242.txt">Table of n, a(n) for n = 1..10000</a>
%F A175242 Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = A244162 = 2.378795... . - _Amiram Eldar_, Jan 01 2024
%e A175242 a(3) = 2 since 3 has 2 divisors, 1 and 3, that are palindromes when written in binary: 1 and 11.
%p A175242 a:= n-> add(`if`(l=ListTools[Reverse](l), 1, 0), l=
%p A175242         map(Bits[Split], numtheory[divisors](n))):
%p A175242 seq(a(n), n=1..105);  # _Alois P. Heinz_, Jul 15 2022
%t A175242 palbQ[n_]:=Module[{idn2=IntegerDigits[n,2]},idn2==Reverse[idn2]]; Table[ Count[ Divisors[ n],_?(palbQ[#]&)],{n,110}] (* _Harvey P. Dale_, Mar 27 2019 *)
%t A175242 a[n_] := DivisorSum[n, 1 &, PalindromeQ @ IntegerDigits[#, 2] &]; Array[a, 100] (* _Amiram Eldar_, Jan 01 2020 *)
%o A175242 (PARI) is(n) = my(d=binary(n)); d==Vecrev(d); \\ A006995
%o A175242 a(n) = sumdiv(n, d, is(d)); \\ _Michel Marcus_, Jul 15 2022
%o A175242 (Python)
%o A175242 from sympy import divisors
%o A175242 def c(n): b = bin(n)[2:]; return b == b[::-1]
%o A175242 def a(n): return sum(1 for d in divisors(n, generator=True) if c(d))
%o A175242 print([a(n) for n in range(1, 106)]) # _Michael S. Branicky_, Jul 15 2022
%Y A175242 Cf. A006995, A244162.
%K A175242 base,nonn
%O A175242 1,3
%A A175242 _Leroy Quet_, Mar 11 2010
%E A175242 Extended by _Ray Chandler_, Mar 13 2010