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!)
A104166 Repdigit Smith numbers. 2

%I #13 Apr 22 2021 18:06:51

%S 4,22,666,1111,6666666,4444444444,44444444444444444444,

%T 555555555555555555555555555,55555555555555555555555555555555,

%U 4444444444444444444444444444444444444444444444444444444

%N Repdigit Smith numbers.

%H S. S. Gupta, <a href="http://www.shyamsundergupta.com/smith.htm">Smith Numbers</a>.

%t d[n_]:=IntegerDigits[n]; tr[n_]:=Transpose[FactorInteger[n]]; a[n_]:=NestList[FromDigits[Flatten[d[{#,n}]]]&,n,55]; t={}; Do[If[!PrimeQ[n]&&Total[d[n]]==Total[d@tr[n][[1]]*tr[n][[2]],2],AppendTo[t,n]],{n,Drop[Union[Flatten[Table[a[k],{k,9}]]],1]}]; t (* _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 repsto(limit):

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

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

%o for digit in "123456789":

%o out = int(digit*rep)

%o if out > limit: return

%o yield out

%o print(list(filter(smith, repsto(10**32)))) # _Michael S. Branicky_, Apr 22 2021

%Y Cf. A006753.

%Y Subsequence of both A098834 and A104171.

%K base,nonn

%O 1,1

%A _Shyam Sunder Gupta_, Mar 10 2005

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 March 28 08:22 EDT 2024. Contains 371236 sequences. (Running on oeis4.)