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.

A087990 Number of palindromic divisors of n.

This page as a plain text file.
%I A087990 #27 Jan 01 2024 07:59:04
%S A087990 1,2,2,3,2,4,2,4,3,3,2,5,1,3,3,4,1,5,1,4,3,4,1,6,2,2,3,4,1,5,1,4,4,2,
%T A087990 3,6,1,2,2,5,1,5,1,6,4,2,1,6,2,3,2,3,1,5,4,5,2,2,1,6,1,2,4,4,2,8,1,3,
%U A087990 2,4,1,7,1,2,3,3,4,4,1,5,3,2,1,6,2,2,2,8,1,6,2,3,2,2,2,6,1,3,6,4,2,4,1,4,4
%N A087990 Number of palindromic divisors of n.
%H A087990 Indranil Ghosh, <a href="/A087990/b087990.txt">Table of n, a(n) for n = 1..10000</a>
%F A087990 Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = A118031 = 3.370283... . - _Amiram Eldar_, Jan 01 2024
%e A087990 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]=10; so 10 of 12 divisors of n are palindromic: {1, 2, 3, 4, 6, 11, 22, 33, 44, 66}.
%t A087990 nd[x_, y_] := 10*x+y; tn[x_] := Fold[nd, 0, x]; rdi[x_] := tn[Reverse[IntegerDigits[x]]]; d0[x_] := DivisorSigma[0, x]; di[x_, i_] := Part[Divisors[x], i]; Table[Count[Divisors[s]-Table[rdi[di[s, w]], {w, 1, d0[s]}], 0], {s, 1, 256}]
%t A087990 palQ[n_] := Reverse[x = IntegerDigits[n]] == x; Table[Count[Divisors[n], _?(palQ[#] &)], {n, 105}] (* _Jayanta Basu_, Aug 10 2013 *)
%t A087990 Table[Count[Divisors[n],_?PalindromeQ],{n,110}] (* Requires Mathematica version 10 or later *) (* _Harvey P. Dale_, Jun 28 2017 *)
%o A087990 (Python)
%o A087990 def ispal(n):
%o A087990     t = str(n)
%o A087990     return t == t[::-1]
%o A087990 def A087990(n):
%o A087990     s=0
%o A087990     for i in range(1,n+1):
%o A087990         if n%i==0 and ispal(i):
%o A087990             s+=1
%o A087990     return s # _Indranil Ghosh_, Feb 10 2017
%o A087990 (PARI) a(n) = sumdiv(n, d, my(dd=digits(d)); Vecrev(dd) == dd); \\ _Michel Marcus_, Apr 06 2020
%Y A087990 Cf. A062687, A087991, A088000, A118031.
%K A087990 nonn,base
%O A087990 1,2
%A A087990 _Labos Elemer_, Oct 08 2003