login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A098834 Palindromic Smith numbers. 6

%I #12 Apr 22 2021 21:54:14

%S 4,22,121,202,454,535,636,666,1111,1881,3663,7227,7447,9229,10201,

%T 17271,22522,24142,28182,33633,38283,45054,45454,46664,47074,50305,

%U 51115,51315,54645,55055,55955,72627,81418,82628,83038,83938,90409,95359,96169,164461

%N Palindromic Smith numbers.

%H Donovan Johnson, <a href="/A098834/b098834.txt">Table of n, a(n) for n = 1..10000</a>

%e a(3) = 121 because 121 is a Smith number as well as a palindromic number.

%t 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 (Python)

%o from sympy import factorint

%o from itertools import product

%o def sd(n): return sum(map(int, str(n)))

%o def smith(n):

%o f = factorint(n)

%o return sum(f[p] for p in f) > 1 and sd(n) == sum(sd(p)*f[p] for p in f)

%o def palsto(limit):

%o yield from range(min(limit, 9)+1)

%o midrange = [[""], [str(i) for i in range(10)]]

%o for digs in range(2, 10**len(str(limit))):

%o for p in product("0123456789", repeat=digs//2):

%o left = "".join(p)

%o if left[0] == '0': continue

%o for middle in midrange[digs%2]:

%o out = int(left + middle + left[::-1])

%o if out > limit: return

%o yield out

%o print(list(filter(smith, palsto(164461)))) # _Michael S. Branicky_, Apr 22 2021

%Y Cf. A006753.

%Y Subsequence of A104171. Supersequence of A104166.

%K base,nonn

%O 1,1

%A _Shyam Sunder Gupta_, Oct 10 2004

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 19 16:52 EDT 2024. Contains 371794 sequences. (Running on oeis4.)