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.

Showing 1-3 of 3 results.

A050219 Smaller of Smith brothers.

Original entry on oeis.org

728, 2964, 3864, 4959, 5935, 6187, 9386, 9633, 11695, 13764, 16536, 16591, 20784, 25428, 28808, 29623, 32696, 33632, 35805, 39585, 43736, 44733, 49027, 55344, 56336, 57663, 58305, 62634, 65912, 65974, 66650, 67067, 67728, 69279, 69835, 73615, 73616, 74168
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Maple
    issmith:= proc(n)
      if isprime(n) then return false fi;
      convert(convert(n,base,10),`+`) = add(t[2]*convert(convert(t[1],base,10),`+`),t=ifactors(n)[2])
    end proc:
    S:= select(issmith, {$4..10^5}):
    sort(convert(S intersect map(`-`,S,1), list)); # Robert Israel, Jan 15 2018
  • Mathematica
    smithQ[n_] := !PrimeQ[n] && Total[Flatten[IntegerDigits[Table[#[[1]], {#[[2]]}]& /@ FactorInteger[n]]]] == Total[IntegerDigits[n]];
    Select[Range[10^5], smithQ[#] && smithQ[#+1]&] (* Jean-François Alcover, Jun 07 2020 *)
  • PARI
    isone(n) = {if (!isprime(n), f = factor(n); sumdigits(n) == sum(k=1, #f~, f[k,2]*sumdigits(f[k,1])););}
    isok(n) =  isone(n) && isone(n+1); \\ Michel Marcus, Jul 17 2015
    
  • Python
    from sympy import factorint
    from itertools import count, islice
    def sd(n): return sum(map(int, str(n)))
    def smith():
        for k in count(1):
            f = factorint(k)
            if sum(f[p] for p in f) > 1 and sd(k) == sum(sd(p)*f[p] for p in f):
                yield k
    def agen():
        prev = -1
        for s in smith():
            if s == prev + 1: yield prev
            prev = s
    print(list(islice(agen(), 38))) # Michael S. Branicky, Dec 23 2022

Extensions

Offset corrected by Arkadiusz Wesolowski, May 08 2012

A050218 Sums of digits of Smith numbers A006753.

Original entry on oeis.org

4, 4, 9, 13, 13, 13, 4, 13, 4, 13, 13, 13, 13, 13, 18, 13, 13, 15, 13, 15, 13, 13, 13, 13, 18, 21, 15, 13, 15, 15, 18, 15, 15, 18, 15, 13, 17, 18, 15, 22, 15, 15, 15, 22, 13, 15, 13, 22, 22, 15, 4, 13, 13, 13, 13, 15, 17, 18, 13, 15, 15, 13, 13, 22, 17, 18, 21, 22, 13, 15
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    d[n_]:=IntegerDigits[n]; tr[n_]:=Transpose[FactorInteger[n]]; t={}; Do[If[!PrimeQ[n]&&(x=Total[d[n]])==Total[d@tr[n][[1]]*tr[n][[2]],2],AppendTo[t,x]],{n,4,1850}]; t (* Jayanta Basu, Jun 04 2013 *)

Formula

a(n) = A007953(A006753(n)).

Extensions

Offset corrected by Reinhard Zumkeller, Dec 19 2011

A331464 Numbers k such that k and k + 1 are both binary Smith numbers (A278909).

Original entry on oeis.org

1369, 1370, 1390, 1630, 1929, 2525, 2526, 2930, 3013, 3309, 3501, 3502, 3686, 3805, 3953, 3954, 4043, 4726, 4854, 5620, 5621, 5917, 6068, 6682, 6774, 6838, 7025, 7089, 7115, 7671, 7738, 7786, 8075, 9654, 9915, 10366, 10982, 11166, 11227, 11506, 11673, 11740, 11763
Offset: 1

Views

Author

Amiram Eldar, Jan 17 2020

Keywords

Examples

			1369 is in the sequence since both 1369 and 1369 + 1 = 1370 are binary Smith numbers.
		

Crossrefs

Programs

  • Mathematica
    binWt[n_] := Total @ IntegerDigits[n, 2]; binSmithQ[n_] := CompositeQ[n] && Plus @@ (Last@# * binWt[ First@# ] & /@ FactorInteger[n]) == binWt[n]; seq = {}; isSmith1 = binSmithQ[1]; Do[isSmith2 = binSmithQ[n]; If[isSmith1 && isSmith2, AppendTo[seq, n-1]]; isSmith1 = isSmith2, {n, 2, 12000}]; seq
Showing 1-3 of 3 results.