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.

A361181 Numbers such that both sum and product of the prime factors (without multiplicity) are palindromic.

Original entry on oeis.org

2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 16, 18, 24, 25, 27, 32, 36, 48, 49, 54, 64, 72, 81, 96, 101, 108, 121, 125, 128, 131, 144, 151, 162, 181, 191, 192, 216, 243, 256, 288, 313, 324, 343, 353, 373, 383, 384, 432, 486, 512, 576, 625, 648, 717, 727, 729, 757, 768, 787, 797, 864, 919, 929, 972, 989
Offset: 1

Views

Author

Alexandru Petrescu, Mar 06 2023

Keywords

Comments

A002385 (Palindromic primes) is a subsequence of this sequence.

Examples

			2151 is a term because 2151=3^2*239; 3+239=242; 3*239=717.
		

Crossrefs

Cf. A002113 (palindromes), A008472, A007947.

Programs

  • Mathematica
    Select[Range[2, 1000], And @@ PalindromeQ /@ {Plus @@ (p = FactorInteger[#][[;; , 1]]), Times @@ p} &] (* Amiram Eldar, Mar 06 2023 *)
  • PARI
    ispal(n) = my(d=digits(n)); d == Vecrev(d) \\ A002113
    for(n=2,1e5; f=factor(n); sf=0; mf=1;for(j=1,#f~, sf+=f[j,1]; mf*=f[j,1]); if(ispal(sf) && ispal(mf),print1(n,", ")))
    
  • Python
    from math import prod
    from sympy import factorint
    def ispal(n): return (s:=str(n)) == s[::-1]
    def ok(n): return ispal(sum(f:=factorint(n))) and ispal(prod(f))
    print([k for k in range(2, 999) if ok(k)]) # Michael S. Branicky, Mar 06 2023