%I #16 Jun 13 2017 03:51:09
%S 1,1,2,1,2,1,1,1,3,1,1,1,1,3,1,1,1,1,2,3,1,2,1,2,2,2,1,2,1,1,4,1,2,1,
%T 1,2,2,1,2,2,1,2,1,3,1,1,1,1,1,2,4,1,1,2,2,3,1,1,1,2,2,1,4,1,1,1,2,1,
%U 1,4,1,1,1,2,2,2,1,3,1,2,3,2,1,3,2,1,3
%N Number of pairs of distinct divisors of A260703(n) having the property that the reversal of one is equal to the other.
%C A260703: numbers having at least two divisors such that the reversal of one is equal to the other.
%H Michel Lagneau, <a href="/A260704/b260704.txt">Table of n, a(n) for n = 1..10000</a>
%e a(9)=3 because A260703(9) = 336 and the set of the divisors of 336, {1, 2, 3, 4, 6, 7, 8, 12, 14, 16, 21, 24, 28, 42, 48, 56, 84, 112, 168, 336} contains 3 pairs (12, 21), (24, 42) and (48, 84) with the property: 21 = reversal(12), 42 = reversal(24) and 84 = reversal(48).
%p with(numtheory):nn:=5000:
%p for n from 1 to nn do:
%p it:=0:d:=divisors(n):d0:=nops(d):
%p for i from 1 to d0 do:
%p dd:=d[i]:y:=convert(dd,base,10):n1:=length(dd):
%p s:=sum('y[j]*10^(n1-j)', 'j'=1..n1):
%p for k from i+1 to d0 do:
%p if s=d[k]
%p then
%p it:=it+1:
%p else fi:
%p od:
%p od:
%p if it>0
%p then
%p printf(`%d, `,it):
%p else fi:
%p od:
%t f[n_] := Block[{d = Select[Divisors@n, IntegerLength@# > 1 &], palQ, r}, palQ[x_] := Reverse@ # == # &@ IntegerDigits@ x; r = FromDigits@ Reverse@ IntegerDigits@ # & /@ d; Length@ Select[Intersection[d, r], ! palQ@ # &]/2]; f /@ Range@ 3000 /. 0 -> Nothing (* _Michael De Vlieger_, Nov 17 2015 *)
%Y Cf. A000005, A027750, A083815, A260703, A260705.
%K nonn,base
%O 1,3
%A _Michel Lagneau_, Nov 17 2015
|