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-10 of 14 results. Next

A178620 Sum of binary digits ( = sum of ternary digits ) of terms in A037301.

Original entry on oeis.org

0, 1, 2, 3, 2, 3, 2, 3, 2, 3, 3, 2, 3, 4, 5, 4, 5, 4, 5, 4, 4, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 6, 7, 3, 3, 4, 5, 5, 4, 5, 4, 5, 4, 5, 5, 6, 7, 4, 4, 5, 5, 5, 4, 5, 5, 4, 5, 6, 7, 5, 7, 6, 4, 5, 4, 5, 6, 7, 6, 7, 6, 7, 6, 7, 7, 7, 6, 4, 5, 4, 5, 6, 7, 4, 5, 5, 6, 7, 6, 7, 6, 7, 5, 5, 7, 4, 5, 6, 6
Offset: 0

Views

Author

Zak Seidov, May 31 2010

Keywords

Crossrefs

Cf. A037301 (sum of base 2 digits of n) = (sum of base 3 digits of n).

Programs

  • Mathematica
    s = {}; Do[id3 = IntegerDigits[n, 3]; id2 = IntegerDigits[n, 2];
    If[(t = Total[id2]) == Total[id3], AppendTo[s, t]], {n, 0, 10^3}]; s

A212222 Integers whose sum of digits in base b is the same for every prime b up to 11.

Original entry on oeis.org

0, 1, 1386, 1387, 485353, 981435, 4423035, 14187855, 19652536, 19652537, 19654636, 19654637, 23059876, 23059877, 23063359, 23837177, 25009516, 25009517, 41185278, 41185279, 41409018, 41409019, 49650315, 50262556, 50262557, 58622956, 58622957, 58623315
Offset: 1

Views

Author

Stanislav Sykora, May 06 2012

Keywords

Comments

This sequence is a subsequence of A135127 for bases 2,3,5,7, which is a subsequence of A135121 for bases 2,3,5, which is a subsequence of A037301 for bases 2,3.
Problem: Is the sequence finite?

Examples

			1386 = 10101101010_2 = 1220100_3 = 21021_5 = 4020_7 = 1050_11. In each of these bases, the sum of the digits is 6.
		

Crossrefs

Extensions

Offset corrected by Thomas König, Aug 16 2020
Name edited by Michel Marcus, Aug 17 2020

A180017 Difference of sums of digits of n in ternary and in binary.

Original entry on oeis.org

0, 0, 1, -1, 1, 1, 0, 0, 3, -1, 0, 0, 0, 0, 1, -1, 3, 3, 0, 0, 2, 0, 1, 1, 2, 2, 3, -3, -1, -1, -2, -2, 3, 1, 2, 2, 0, 0, 1, -1, 2, 2, 1, 1, 3, -1, 0, 0, 2, 2, 3, 1, 3, 3, -2, -2, 1, -1, 0, 0, 0, 0, 1, -3, 3, 3, 2, 2, 4, 2, 3, 3, 2, 2, 3, 1, 3, 3, 2, 2, 6, -2, -1, -1, -1, -1, 0, -2, 1, 1, -2, -2, 0
Offset: 0

Views

Author

Reinhard Zumkeller, Aug 06 2010

Keywords

Comments

This sequence is positive on average, since 1/log(3) > 1/log(4). Do all integers appear infinitely often? - Charles R Greathouse IV, Feb 07 2013

Examples

			For n = 7 = 21_3 = 111_2, a(n) = (2+1) - (1+1+1) = 0.
For n = 8 = 22_3 = 1000_2, a(n) = (2+2) - (1+0+0+0) = 3.
For n = 9 = 100_3 = 1001_2, a(n) = (1+0+0) - (1+0+0+1) = -1.
		

Crossrefs

Programs

  • Mathematica
    Table[Total[IntegerDigits[n,3]]-Total[IntegerDigits[n,2]],{n,0,100}] (* Harvey P. Dale, Dec 08 2015 *)
  • PARI
    a(n) = sumdigits(n,3) - sumdigits(n,2); \\ Michel Marcus, Nov 12 2023

Formula

a(n) = A053735(n) - A000120(n);
a(A037301(n)) = 0;
a(A000244(n)) = 1 - A000120(A000244(n));
a(A000079(n)) = A053735(A000079(n)) - 1;
a(A024023(n)) = 2*n - A000120(A024023(n)); a(A000225(n)) = A053735(A000225(n)) - n.
a(n) = A011371(n) - 2*A054861(n). - Henry Bottomley, Feb 16 2024

A317725 a(n) is the smallest k > 1 whose sum of digits is the same in all the bases from 2 to n.

Original entry on oeis.org

2, 6, 21, 23162843828305
Offset: 2

Views

Author

Giovanni Resta, Aug 05 2018

Keywords

Comments

No other terms below 4^60 ~= 1.3*10^36. The sequence is likely finite and complete. - Max Alekseyev, Aug 29 2023

Examples

			a(3) = A037301(3).
a(4) = A135122(2).
a(5) = A317777(2) = 23162843828305 in base 2, 3, 4, and 5 is equal to: 101010001000100000101000101000001000001010001, 10001000100100102010101011001, 11101010011011001001101, and 11014000001010001210, respectively. The sum of the digits is 13 in the 4 cases.
		

Crossrefs

Programs

  • PARI
    isok(k, n) = #Set(vector(n-1, b, b++; sumdigits(k, b))) == 1;
    a(n) = my(k=2); while (!isok(k, n), k++); k; \\ Michel Marcus, Sep 02 2023

Extensions

a(2) = 2 prepended by Max Alekseyev, Aug 29 2023

A330904 Numbers m such that the number of 1's in the binary expansion of m equals the sum of the balanced ternary trits of m.

Original entry on oeis.org

0, 1, 10, 12, 13, 34, 36, 37, 66, 67, 120, 121, 192, 193, 202, 264, 265, 272, 273, 282, 283, 354, 355, 360, 361, 514, 516, 517, 520, 526, 544, 576, 577, 688, 840, 841, 848, 849, 904, 928, 1026, 1027, 1028, 1029, 1032, 1033, 1038, 1039, 1062, 1063, 1074, 1075
Offset: 1

Views

Author

Thomas König, May 02 2020

Keywords

Comments

If a(n) mod 6 = 0, then a(n+1) = a(n)+1.
a(41) = 1026, a(42) = 1027, a(43) = 1028 and a(44) = 1029 is the first time that four consecutive numbers appear in a(n). Conjecture: There is no occurrence of five or more consecutive numbers in a(n). Tested by exhaustive search up to 3^30. - Thomas König, Jul 19 2020

Examples

			34_10 = 11T1_bt = 10010_2, the sum of the digits is 1+1-1+1 = 2 for balanced ternary and 1+1 = 2 for base 2, so 34 is a term.
		

Crossrefs

Aside from the first term, subsequence of A174659.

Programs

  • PARI
    bt(n)= if (n==0, return (0)); my(d=digits(n, 3), c=1); while(c, if(d[1]==2, d=concat(0, d)); c=0; for(i=2, #d, if(d[i]==2, d[i]=-1; d[i-1]+=1; c=1))); vecsum(d); \\ A065363
    isok(m) = bt(m) == hammingweight(m); \\ Michel Marcus, Jun 07 2020

Formula

Integers m such that A065363(m) = A000120(m).

Extensions

Offset corrected by Thomas König, Jul 09 2020

A335839 Integers whose sum of digits in base b is the same for every prime b up to 13.

Original entry on oeis.org

0, 1, 2007986541, 2834822783, 31939595966, 33952616126, 42737313983, 44878987167, 309231463167, 318362221465, 415332522143, 881935644447, 1898245489647, 2077690289610, 2077690289611, 2153926044391, 3998461033469, 4285034622330, 4285034622331, 4294899857375
Offset: 1

Views

Author

Thomas König, Sep 13 2020

Keywords

Comments

This is a subset of A212222 for bases 2, 3, 5, 7, 11, which is a subset of A135127 for bases 2, 3, 5, 7, which is a subset of A135121 for bases 2 ,3, 5, which is a subset of A037301 for bases 2, 3. The third term also occurs in A212223.

Examples

			31939595966 is 11101101111101111111000111010111110_2, 10001102220222120211202_3, 1010403014032331_5, 2210331041405_7, 12600084203_11 and 3020180615_13. In these bases, the sum of digits is 26, so 31939595966 is a term.
		

Crossrefs

Programs

  • Python
    def digsum(n,b):
        s = 0
        while n > 0:
            n, d = n//b, n%b
            s = s+d
        return s
    p = [2,3,5,7,11,13]
    n, a = 0, 0
    while n <= 20:
        s2, i = digsum(a,2), 1
        while i < len(p) and digsum(a,p[i]) == s2:
            i = i+1
        if i == len(p):
            print(a, end = ", ")
            n = n+1
        a = a+1 # A.H.M. Smeets, May 16 2021

A212223 a(n) is the least integer greater than 1 whose expansion in prime bases 2 to prime(n) have equal sum of digits.

Original entry on oeis.org

2, 6, 6, 882, 1386, 2007986541, 70911040973874056146188543
Offset: 1

Views

Author

Stanislav Sykora, May 10 2012

Keywords

Comments

Case a(1) is trivial since only base prime(1)=2 is involved.
Conjecture: the sequence never terminates.
a(7) > 2.3*10^16, if it exists. - Giovanni Resta, Oct 29 2018
Based on a search for the next term of A345296, a(8) is larger than 2.1*10^28. - Thomas König, Dec 15 2024

Examples

			a(5) = 1386 because that number has the same sum of digits in the first 5 prime bases 2, 3, 5, 7, 11 (see A212222 and A000040).
		

Crossrefs

Programs

  • Mathematica
    f[n_] := Block[{p = Prime@ Range@ n, k = 2}, While[ Length[ Union[ Total@# & /@ IntegerDigits[k, p]]] != 1, k++]; k] (* Robert G. Wilson v, Oct 24 2014 *)
  • PARI
    isok(n, k) = my(s=hammingweight(k)); forprime (b=3, prime(n), if (sumdigits(k, b) != s, return (0))); return (1);
    a(n) = my(k=2); while (!isok(n, k), k++); k; \\ Michel Marcus, Jun 08 2021

Extensions

Name edited by Michel Marcus, Sep 14 2020
a(7) from Thomas König, Jun 08 2021

A317777 Numbers whose digital sums in bases 2, 3, 4, and 5 are all equal.

Original entry on oeis.org

1, 23162843828305, 5722224662500629, 25185954575304707081301, 407805072367801818857674005, 1705412607407578552438012746487125, 1705412607426764386750185803694405, 1705412607426764386750185803695125, 1705412607426764386750186877112645, 1705412607431411795338502226662661
Offset: 1

Views

Author

Giovanni Resta, Aug 06 2018

Keywords

Comments

Comment from Max Alekseyev, Dec 11 2024 (Start)
The beginning of the sequence suggests that the terms may be rather sparse.
However, as terms become larger, they tend to appear in unexpected constellations such as:
89675268900935540640454882129695060
89675268900935540640454882129695061
89675268900935540640454933652788500
89675268900935540640454933652788501
89675273848747799396737823490250005
or
113343080811409868866589092414267671876
113343080811409868866589092414267671877
113343080811409868867743138448975156500
113343080811409868867743138448975156501
113343080811409868867760032719746187600
113343080811409868867760032719746187601
113343080811409868867760239410949735765
113343080811409868867761158326773437508
113343080811409868867761158326773437509
I can explain when two terms differ by 1, where the first one happens to end with a digit < b-1 for each base b in {2,3,4,5}, but the above constellations are a total mystery.
(End)

Examples

			23162843828305 in bases 2, 3, 4, and 5 is equal to 101010001000100000101000101000001000001010001, 10001000100100102010101011001, 11101010011011001001101, and 11014000001010001210, respectively. The sum of the digits is 13 in all four cases.
		

Crossrefs

Subsequence of A037301 and A135122.
Cf. A317725.

Extensions

Terms a(5) onward from Max Alekseyev, Sep 09 2023

A334765 Numbers m such that the numbers of 1's in the binary expansion of m equals the negative sum of balanced ternary trits of m.

Original entry on oeis.org

0, 41, 68, 131, 132, 368, 384, 528, 1095, 1098, 1100, 1106, 1112, 1122, 1124, 1152, 1176, 1346, 1824, 2561, 3282, 3284, 3336, 3344, 3392, 3524, 4098, 4101, 4104, 4112, 4118, 4128, 4172, 4352, 4496, 4739, 4740, 5504, 6224, 9856, 9857, 9869, 9896, 9923, 9924
Offset: 1

Views

Author

Thomas König, May 10 2020

Keywords

Comments

a(116) = 32770, a(117) = 32771 and a(118) = 32772 is the first time that three consecutive numbers appear in this sequence. Conjecture: There is no occurrence of four or more consecutive numbers. Tested by exhaustive search up to a(n) = 3^26. - Thomas König, Jul 19 2020

Examples

			41_10 = 1TTTT_bt = 101001_2, the sum of the digits is 1-1-1-1-1 = -3 for balanced ternary and 1+1+1 = 3 for base 2, so 41 is a term.
		

Crossrefs

Aside from the first term, subsequence of A174657.

Programs

  • Mathematica
    Select[Range[0, 10^4], -Total@ If[First@ # == 0, Rest@ #, #] &[Prepend[IntegerDigits[#, 3], 0] //. {x___, y_, k_ /; k > 1, z___} :> {x, y + 1, -1, z}] == DigitCount[#, 2, 1] &] (* Michael De Vlieger, Jul 08 2020 *)
  • PARI
    bt(n)= if (n==0, return (0)); my(d=digits(n, 3), c=1); while(c, if(d[1]==2, d=concat(0, d)); c=0; for(i=2, #d, if(d[i]==2, d[i]=-1; d[i-1]+=1; c=1))); vecsum(d); \\ A065363
    isok(m) = bt(m) + hammingweight(m) == 0; \\ Michel Marcus, Jun 07 2020

Formula

Integers m such that -A065363(m) = A000120(m).

A375257 Numbers whose sum of base-2 digits is 1 more than their sum of base-3 digits.

Original entry on oeis.org

3, 9, 15, 28, 29, 39, 45, 57, 82, 83, 84, 85, 94, 95, 99, 110, 118, 119, 123, 135, 162, 163, 165, 174, 175, 183, 207, 219, 248, 297, 303, 315, 324, 325, 334, 335, 342, 343, 363, 382, 383, 406, 407, 411, 423, 435, 441, 447, 459, 488, 494, 496, 497, 502, 503, 506, 508, 509, 543, 570, 571, 573, 603
Offset: 1

Views

Author

Robert Israel, Aug 07 2024

Keywords

Comments

Numbers k such that A000120(k) = A053735(k) + 1.

Examples

			a(3) = 15 is a term because 15 = 1111_2 = 120_3 so A000120(15) = 1+1+1+1 = 4 and A053735(15) = 1+2+0 = 3.
		

Crossrefs

Programs

  • Maple
    filter:= proc(n) convert(convert(n,base,2),`+`) = convert(convert(n,base,3),`+`)+1 end proc:
    select(filter, [$1..1000]);
  • Mathematica
    Select[Range[600], Subtract @@ DigitSum[#, {2, 3}] == 1 &] (* Amiram Eldar, Aug 08 2024 *)
  • PARI
    isok(k) = sumdigits(k,2) == 1 + sumdigits(k, 3); \\ Michel Marcus, Aug 08 2024
  • Python
    from sympy.ntheory import digits
    def ok(n): return sum(digits(n, 2)[1:]) == sum(digits(n, 3)[1:]) + 1
    print([k for k in range(604) if ok(k)]) # Michael S. Branicky, Aug 08 2024
    
Showing 1-10 of 14 results. Next