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.

Previous Showing 11-20 of 90 results. Next

A278909 Binary Smith numbers: composite numbers n such that sum of bits of n = sum of bits of prime factors of n (counted with multiplicity).

Original entry on oeis.org

15, 51, 55, 85, 125, 159, 185, 190, 205, 215, 222, 238, 246, 249, 253, 287, 303, 319, 374, 407, 438, 442, 469, 471, 475, 489, 494, 501, 507, 591, 623, 639, 670, 679, 687, 699, 730, 745, 755, 763, 765, 771, 799, 807, 822, 830, 843, 867, 890, 893, 917, 923, 925, 935, 939, 951, 970, 973, 979, 986, 989, 995, 1010, 1015, 1017, 1020, 1023, 1135, 1167, 1203, 1243
Offset: 1

Views

Author

Ely Golden, Nov 30 2016

Keywords

Comments

Binary equivalent of A006753 as well as A176670. (Since bits can only be 0 or 1, having equal sums of bits is logically equivalent to having the same nonzero bits.)
There are 615 terms up to 10^4, 6412 up to 10^5, 66369 up to 10^6, 630106 up to 10^7, 6268949 up to 10^8, 62159262 up to 10^9, and 596587090 up to 10^10. - Charles R Greathouse IV, Dec 09 2016

Examples

			a(1) = 15, as 15 (1111) in binary has the same number of 1 bits as its prime factors (11 and 101).
		

Crossrefs

Programs

  • Mathematica
    Select[Range@ 1250, And[CompositeQ@ #, DigitCount[#, 2, 1] = Total@ Flatten@ Apply[DigitCount[#, 2, 1] & /@ ConstantArray[#1, #2] &, FactorInteger@ #, 1]] &] (* Michael De Vlieger, Dec 02 2016 *)
  • PARI
    is(n) = my(f=factor(n)[, 1]~, expo=factor(n)[, 2]~, v=[], s=0); for(k=1, #f, while(expo[k] > 0, expo[k]--; v=concat(v, f[k]))); for(k=1, #v, v[k]=binary(v[k])); my(w=[]); for(y=1, #v, w=concat(w, v[y])); if(vecsum(w)==vecsum(binary(n)), return(1), return(0))
    terms(n) = my(i=0); forcomposite(c=1, , if(is(c), print1(c, ", "); i++; if(i==n, break)))
    /* Print initial 70 terms as follows: */
    terms(70) \\ Felix Fröhlich, Dec 01 2016
    
  • PARI
    is(n)=my(f=factor(n),t=#f~); (t>1 || (t==1 && f[1,2]>1)) && hammingweight(n)==sum(i=1,t, hammingweight(f[i,1])*f[i,2]) \\ Charles R Greathouse IV, Dec 02 2016
    
  • Python
    from sympy import factorint
    def sbd(n): return bin(n).count('1')
    def ok(n):
      f = factorint(n)
      return sum(f[p] for p in f) > 1 and sbd(n) == sum(sbd(p)*f[p] for p in f)
    print(list(filter(ok, range(1244)))) # Michael S. Branicky, Apr 22 2021
  • SageMath
    def numfactorbits(x):
        if(x<2):
            return 0;
        s=0;
        f=list(factor(x));
        #ensures inequality of numfactorbits(x) and bin(x).count("1") if x is prime
        if((len(f)==1)&(f[0][1]==1)):
            return 0;
        for c in range(len(f)):
            s+=bin(f[c][0]).count("1")*f[c][1]
        return s;
    counter=2
    index=1
    while(index<=10000):
        if(numfactorbits(counter)==bin(counter).count("1")):
            print(str(index)+" "+str(counter))
            index+=1;
        counter+=1;
    

A067077 Numbers whose product of distinct prime factors is equal to its sum of digits.

Original entry on oeis.org

1, 2, 3, 5, 6, 7, 24, 375, 392, 640, 2401, 4802, 4913, 6400, 7744, 17576, 42592, 64000, 106496, 234256, 295936, 468750, 546875, 628864, 640000, 877952, 1124864, 1966080, 2839714, 3687936, 4687500, 4816896, 4952198, 6400000, 6453888
Offset: 1

Views

Author

Joseph L. Pe, Feb 18 2002

Keywords

Comments

The product of the distinct prime factors of n (the squarefree kernel of n) is also denoted by rad(n) = A007947(n). - Giovanni Resta, Apr 21 2017

Examples

			The prime factors of 375 are 3,5, which have product = 15, the sum of the digits of 375, so 375 is a term of the sequence.
		

Crossrefs

Programs

  • Mathematica
    f[n_] := Times@@ (First/@ FactorInteger[n]); g[n_] := Plus @@ IntegerDigits[n]; Select[Range[10^5], f[#] == g[#] &] (* or *)
    nd=12; up=10^nd; L={1}; Do[If[SquareFreeQ[su], ps = First /@ FactorInteger[su]; nps = Length@ ps; Clear[ric]; ric[n_, i_] := Block[{e = 0, m}, If[i > nps, If[Plus @@ IntegerDigits[su n] == su, Sow[su n]], While[ (m = n ps[[i]]^e ) su < up, ric[m, i+1]; e++]]]; z = Reap[ ric[1, 1]][[2]]; If[z != {}, L = Union[L, z[[1]]]]], {su, 2, 9 nd}]; L (* fast, terms < 10^12, Giovanni Resta, Apr 21 2017 *)
    Select[Range[65*10^5],Times@@FactorInteger[#][[All,1]]==Total[ IntegerDigits[ #]]&] (* Harvey P. Dale, Dec 16 2018 *)
  • PARI
    isok(k)={vecprod(factor(k)[,1]) == sumdigits(k)} \\ Harry J. Smith, May 06 2010

Extensions

a(19)-a(35) from Donovan Johnson, Sep 29 2009
a(1)=1 prepended by Giovanni Resta, Apr 21 2017

A174460 Smith numbers of order 2.

Original entry on oeis.org

56, 58, 810, 822, 1075, 1519, 1752, 2145, 2227, 2260, 2483, 2618, 2620, 3078, 3576, 3653, 3962, 4336, 4823, 4974, 5216, 5242, 5386, 5636, 5719, 5762, 5935, 5998, 6220, 6424, 6622, 6845, 7015, 7251, 7339, 7705, 7756, 8460, 9254, 9303, 9355, 10481, 10626, 10659
Offset: 1

Views

Author

Paul Weisenhorn, Dec 20 2010

Keywords

Comments

Composite numbers a(n) such that the sum of digits^2 equals the sum of digits^2 of its prime factors without the numbers of A176670 that have the same digits as its prime factors (without the zero digit).
It seems as though as the order n approaches infinity, the sequence of n-order Smith numbers approaches A176670. Is there a value of n where the only n-order Smith numbers are members of A176670? - Ely Golden, Dec 07 2016

Examples

			a(2) = 58 = 2*29 is a Smith number of order 2 because 5^2 + 8^2 = 2^2 + 2^2 + 9^2 = 89.
		

Crossrefs

Cf. A006753 (Smith numbers), A176670, A178213, A178193, A178203, A178204.

Programs

  • Maple
    for s from 2 to 10000 do g:=nops(ifactors(s)[2]): qsp:=0: for u from 1 to g do z:=ifactors(s)[2,u][1]: h:=0: while (z>0) do z:=iquo(z,10,'r'): h:=h+r^2: end do: h:=h*ifactors(s)[2,u][2]: qsp:=qsp+h: end do: z:=s: qs:=0: while (z>0) do z:=iquo(z,10,'r'): qs:=qs+r^2: end do: if (qsp=qs) then print(s): end if: end do:
  • Mathematica
    With[{k = 2},Select[Range[12000], Function[n, And[Total@ Map[#^k &, IntegerDigits@ n] == Total@ Map[#^k &, Flatten@ IntegerDigits[#]], Not[Sort@ DeleteCases[#, 0] &@ IntegerDigits@ n == Sort@ DeleteCases[#, 0] &@ #]] &@ Flatten@ Map[IntegerDigits@ ConstantArray[#1, #2] & @@ # &, FactorInteger@ n]]]] (* Michael De Vlieger, Dec 10 2016 *)

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

A178213 Smith numbers of order 3.

Original entry on oeis.org

6606, 8540, 13086, 16866, 21080, 26637, 27468, 33387, 34790, 35364, 35377, 40908, 44652, 48154, 48860, 52798, 54814, 55055, 57726, 57894, 66438, 67297, 67356, 67594, 69549, 72465, 72598, 73026, 74371, 74785, 77485, 78745, 81546, 83175, 85927, 90174, 91208
Offset: 1

Views

Author

Paul Weisenhorn, Dec 19 2010

Keywords

Comments

Composite numbers n not in A176670 such that the sum of the cubes of the digits of n equals the sum of the cubes of the digits of the prime factors of n (with multiplicity). A176670 lists composite numbers having the same digits as their prime factors (with multiplicity), excluding zero digits.

Examples

			6606 = 2*3*3*367 is composite; sum of cubes of the digits is 6^3+6^3+0^3+6^3 = 648. Sum of cubes of the digits of the prime factors 2, 3, 3, 367 (with multiplicity) is 2^3+3^3+3^3+3^3+6^3+7^3 = 648. The sums are equal, so 6606 is in the sequence.
21080 = 2*2*2*5*17*31 is composite; sum of cubes of the digits is 2^3+1^3+0^3+8^3+0^3 = 521. Sum of cubes of the digits of the prime factors 2, 2, 2, 5, 17, 31 (with multiplicity) is 2^3+2^3+2^3+5^3+1^3+7^3+3^3+1^3 = 521. The sums are equal, so 21080 is in the sequence.
		

Crossrefs

Cf. A006753 (Smith numbers), A174460, A176670, A178193, A178203, A178204.

Programs

  • Mathematica
    fQ[n_] := Block[{id = Sort@ IntegerDigits@ n, fid = Sort@ Flatten[ IntegerDigits@ Table[ #[[1]], {#[[2]]}] & /@ FactorInteger@ n]}, While[ id[[1]] == 0, id = Drop[id, 1]]; While[ fid[[1]] == 0, fid = Drop[fid, 1]]; !PrimeQ@ n && id != fid && Plus @@ (id^3) == Plus @@ (fid^3)]; k = 2; lst = {}; While[k < 22002, If[fQ@ k, AppendTo[ lst, k]; Print@ k]; k++]; lst
    With[{k = 3}, Select[Range[10^5], Function[n, And[Total@ Map[#^k &, IntegerDigits@ n] == Total@ Map[#^k &, Flatten@ IntegerDigits[#]], Not[Sort@ DeleteCases[#, 0] &@ IntegerDigits@ n == Sort@ DeleteCases[#, 0] &@#]] &@ Flatten@ Map[IntegerDigits@ ConstantArray[#1, #2] & @@ # &, FactorInteger@ n]]]] (* Michael De Vlieger, Dec 10 2016 *)

A098834 Palindromic Smith numbers.

Original entry on oeis.org

4, 22, 121, 202, 454, 535, 636, 666, 1111, 1881, 3663, 7227, 7447, 9229, 10201, 17271, 22522, 24142, 28182, 33633, 38283, 45054, 45454, 46664, 47074, 50305, 51115, 51315, 54645, 55055, 55955, 72627, 81418, 82628, 83038, 83938, 90409, 95359, 96169, 164461
Offset: 1

Views

Author

Shyam Sunder Gupta, Oct 10 2004

Keywords

Examples

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

Crossrefs

Cf. A006753.
Subsequence of A104171. Supersequence of A104166.

Programs

  • Mathematica
    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 *)
  • Python
    from sympy import factorint
    from itertools import product
    def sd(n): return sum(map(int, str(n)))
    def smith(n):
      f = factorint(n)
      return sum(f[p] for p in f) > 1 and sd(n) == sum(sd(p)*f[p] for p in f)
    def palsto(limit):
      yield from range(min(limit, 9)+1)
      midrange = [[""], [str(i) for i in range(10)]]
      for digs in range(2, 10**len(str(limit))):
        for p in product("0123456789", repeat=digs//2):
          left = "".join(p)
          if left[0] == '0': continue
          for middle in midrange[digs%2]:
            out = int(left + middle + left[::-1])
            if out > limit: return
            yield out
    print(list(filter(smith, palsto(164461)))) # Michael S. Branicky, Apr 22 2021

A104171 Reversible Smith numbers, i.e., Smith numbers whose reversal is also a Smith number.

Original entry on oeis.org

4, 22, 58, 85, 121, 202, 265, 319, 454, 535, 562, 636, 666, 913, 1111, 1507, 1642, 1881, 1894, 1903, 2461, 2583, 2605, 2614, 2839, 3091, 3663, 3852, 4162, 4198, 4369, 4594, 4765, 4788, 4794, 4954, 4974, 4981, 5062, 5386, 5458, 5539, 5674, 5818, 5926, 6295
Offset: 1

Views

Author

Shyam Sunder Gupta, Mar 10 2005

Keywords

Comments

The palindromic Smith numbers (A098834) are a subset of the reversible Smith numbers.

Examples

			a(3) = 58 because 58 and its reverse 85 are Smith numbers.
		

Crossrefs

Programs

  • Mathematica
    rev[n_] := FromDigits @ Reverse @ IntegerDigits[n]; digSum[n_] := Plus @@ IntegerDigits[n]; smithQ[n_] := CompositeQ[n] && Plus @@ (Last@#*digSum[First@#] & /@ FactorInteger[n]) == digSum[n]; Select[Range[6000], smithQ[#] && smithQ @ rev[#] &] (* Amiram Eldar, Aug 24 2020 *)
  • Python
    from sympy import factorint
    def sd(n): return sum(map(int, str(n)))
    def smith(n):
      f = factorint(n)
      return sum(f[p] for p in f) > 1 and sd(n) == sum(sd(p)*f[p] for p in f)
    def ok(n): return smith(n) and smith(int(str(n)[::-1]))
    print(list(filter(ok, range(6296)))) # Michael S. Branicky, Apr 22 2021

A104390 2-Smith numbers.

Original entry on oeis.org

32, 42, 60, 70, 104, 152, 231, 315, 316, 322, 330, 342, 361, 406, 430, 450, 540, 602, 610, 612, 632, 703, 722, 812, 1016, 1027, 1029, 1108, 1162, 1190, 1246, 1261, 1304, 1314, 1316, 1351, 1406, 1470, 1510, 1603, 2013, 2054, 2065, 2070, 2071, 2106, 2114
Offset: 1

Views

Author

Eric W. Weisstein, Mar 04 2005 and Shyam Sunder Gupta, Mar 11 2005

Keywords

Examples

			32 is a 2-Smith number because the sum of the digits of its prime factors, i.e., Sp (32) = Sp(2*2*2*2*2)= 2 + 2 + 2 + 2 + 2 = 10, which is equal to twice the digit sum of 32, i.e., 2*S(32) = 2*(3 + 2) = 10.
		

Crossrefs

Programs

  • Mathematica
    d[n_]:=IntegerDigits[n]; tr[n_]:=Transpose[FactorInteger[n]]; Select[Range[2120],2Total[d[#]]==Total[d@tr[#][[1]]*tr[#][[2]],2]&] (* Jayanta Basu, Jun 04 2013 *)

A104391 3-Smith numbers.

Original entry on oeis.org

402, 510, 700, 1113, 1131, 1311, 2006, 2022, 2130, 2211, 2240, 3102, 3111, 3204, 3210, 3220, 4031, 4300, 4410, 5310, 6004, 6100, 6300, 7031, 7120, 9000, 10034, 10125, 10206, 10251, 10304, 10413, 10521, 10612, 10800, 11033, 11111, 11114, 11116, 11121, 11141
Offset: 1

Views

Author

Eric W. Weisstein, Mar 04 2005 and Shyam Sunder Gupta, Mar 11 2005

Keywords

Examples

			402 is a 3-Smith number because the sum of the digits of its prime factors, i.e., Sp(402) = Sp(2*3*67)= 2 + 3 + 6 + 7 = 18, which is equal to 3 times the digit sum of 402, i.e., 3*S(402) = 3*(4 + 0 + 2) = 18.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[12000],Total[Flatten[IntegerDigits/@Table[#[[1]],{#[[2]]}]&/@ FactorInteger[#]]]/Total[IntegerDigits[#]]==3&] (* Harvey P. Dale, Feb 19 2013 *)

A178203 Smith numbers of order 5; composite numbers n such that sum of digits^5 equal sum of digits^5 of its prime factors without the numbers in A176670 that have the same digits as its prime factors (without the zero digits).

Original entry on oeis.org

414966, 443166, 454266, 1274664, 1371372, 1701856, 1713732, 1734616, 1771248, 1858436, 1858616, 2075664, 2624976, 3606691, 3771031, 3771301, 4266914, 4414866, 4461786, 4605146, 4670576, 4710739, 5209663, 5281767, 5434572, 5836565, 5861712, 5871968, 6046357
Offset: 1

Views

Author

Paul Weisenhorn, Dec 19 2010

Keywords

Examples

			a(10) = 1858436 = 2*2*29*37*433;
1^5 + 3^5 + 4^5 + 5^5 + 6^5 + 2*8^5 = 3*2^5 + 3*3^5 + 4^5 + 7^5 + 9^5 = 77705.
		

Crossrefs

Cf. A006753 (Smith numbers), A176670, A174460, A178213, A178193, A178204.

Extensions

a(21) corrected by Donovan Johnson, Jan 02 2013
Previous Showing 11-20 of 90 results. Next