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.

A098834 Palindromic Smith numbers.

This page as a plain text file.
%I A098834 #15 Mar 13 2025 11:00:29
%S A098834 4,22,121,202,454,535,636,666,1111,1881,3663,7227,7447,9229,10201,
%T A098834 17271,22522,24142,28182,33633,38283,45054,45454,46664,47074,50305,
%U A098834 51115,51315,54645,55055,55955,72627,81418,82628,83038,83938,90409,95359,96169,164461
%N A098834 Palindromic Smith numbers.
%H A098834 Donovan Johnson, <a href="/A098834/b098834.txt">Table of n, a(n) for n = 1..10000</a>
%H A098834 Shyam Sunder Gupta, <a href="https://doi.org/10.1007/978-981-97-2465-9_4">Smith Numbers</a>, Exploring the Beauty of Fascinating Numbers, Springer (2025) Ch. 4, 127-157.
%e A098834 a(3) = 121 because 121 is a Smith number as well as a palindromic number.
%t A098834 d[n_] := IntegerDigits[n]; tr[n_] := Transpose[FactorInteger[n]]; Select[Range[2, 1.7*10^5], !PrimeQ[#] && Reverse[x=d[#]] == x && Total[x] == Total[d@tr[#][[1]]*tr[#][[2]], 2]&] (* _Jayanta Basu_, Jun 04 2013 *)
%o A098834 (Python)
%o A098834 from sympy import factorint
%o A098834 from itertools import product
%o A098834 def sd(n): return sum(map(int, str(n)))
%o A098834 def smith(n):
%o A098834   f = factorint(n)
%o A098834   return sum(f[p] for p in f) > 1 and sd(n) == sum(sd(p)*f[p] for p in f)
%o A098834 def palsto(limit):
%o A098834   yield from range(min(limit, 9)+1)
%o A098834   midrange = [[""], [str(i) for i in range(10)]]
%o A098834   for digs in range(2, 10**len(str(limit))):
%o A098834     for p in product("0123456789", repeat=digs//2):
%o A098834       left = "".join(p)
%o A098834       if left[0] == '0': continue
%o A098834       for middle in midrange[digs%2]:
%o A098834         out = int(left + middle + left[::-1])
%o A098834         if out > limit: return
%o A098834         yield out
%o A098834 print(list(filter(smith, palsto(164461)))) # _Michael S. Branicky_, Apr 22 2021
%Y A098834 Cf. A006753.
%Y A098834 Subsequence of A104171.  Supersequence of A104166.
%K A098834 base,nonn
%O A098834 1,1
%A A098834 _Shyam Sunder Gupta_, Oct 10 2004