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.

A342572 Positive numbers all of whose prime factors are binary palindromes.

This page as a plain text file.
%I A342572 #30 Jul 23 2023 22:22:08
%S A342572 1,3,5,7,9,15,17,21,25,27,31,35,45,49,51,63,73,75,81,85,93,105,107,
%T A342572 119,125,127,135,147,153,155,175,189,217,219,225,243,245,255,257,279,
%U A342572 289,313,315,321,343,357,365,375,381,405,425,441,443,459,465,511,525,527
%N A342572 Positive numbers all of whose prime factors are binary palindromes.
%H A342572 Amiram Eldar, <a href="/A342572/b342572.txt">Table of n, a(n) for n = 1..10010</a> (terms below 10^7)
%F A342572 Sum_{n>=1} 1/a(n) =  Product_{p in A016041} p/(p-1) = 2.52136...
%e A342572 15 is a term since the binary representation of its prime factors, 3 and 5, are both palindromes: 11 and 101.
%e A342572 1 is a term because it has no prime factors, and "the empty set has every property". - _N. J. A. Sloane_, Jan 16 2022
%t A342572 seq[max_] := Module[{ps = Select[Range[max], PalindromeQ @ IntegerDigits[#, 2] && PrimeQ[#] &], s = {1}, s1, s2}, Do[p = ps[[k]]; emax = Floor@Log[p, max]; s1 = Join[{1}, p^Range[emax]]; s2 = Select[Union[Flatten[Outer[Times, s, s1]]], # <= max &]; s = Union[s, s2], {k, 1, Length[ps]}]; s]; seq[1000]
%t A342572 Join[{1},Module[{bps=Select[Prime[Range[200]],IntegerDigits[#,2] == Reverse[ IntegerDigits[ #,2]]&]},Select[ Range[Max[ bps]],SubsetQ[ bps,FactorInteger[#][[All,1]]]&]]] (* _Harvey P. Dale_, Jan 16 2022 *)
%o A342572 (Python)
%o A342572 from sympy import factorint
%o A342572 def ispal(s): return s == s[::-1]
%o A342572 def ok(n): return n > 0 and all(ispal(bin(f)[2:]) for f in factorint(n))
%o A342572 print([k for k in range(528) if ok(k)]) # _Michael S. Branicky_, Jan 17 2022
%Y A342572 The binary version of A033620.
%Y A342572 Subsequences: A016041, A329419.
%Y A342572 Cf. A006995.
%K A342572 nonn,base
%O A342572 1,2
%A A342572 _Amiram Eldar_, Mar 27 2021
%E A342572 "Positive" added to definition by _N. J. A. Sloane_, Jan 16 2022