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 21-30 of 38 results. Next

A228090 Numbers k for which a sum k + bitcount(k) cannot be obtained as a sum k2 + bitcount(k2) for any other k2<>k . Here bitcount(k) (A000120) gives the number of 1's in binary representation of nonnegative integer k.

Original entry on oeis.org

0, 1, 2, 5, 6, 7, 8, 9, 10, 13, 18, 21, 22, 23, 24, 25, 26, 30, 33, 37, 38, 39, 40, 41, 42, 45, 50, 53, 54, 55, 56, 57, 58, 61, 63, 64, 66, 69, 70, 71, 72, 73, 74, 77, 82, 85, 86, 87, 88, 89, 90, 94, 97, 101, 102, 103, 104, 105, 106, 109, 114, 117, 118, 119, 120
Offset: 1

Views

Author

Antti Karttunen, Aug 17 2013

Keywords

Comments

In other words, numbers k such that A228085(A092391(k)) = 1.

Examples

			0 is in this sequence because the sum 0+A000120(0)=0 cannot be obtained with any other value of k than k=0.
1 is in this sequence because the sum 1+A000120(1)=2 cannot be obtained with any other value of k than k=1.
2 is in this sequence because the sum 2+A000120(2)=3 cannot be obtained with any other value of k than k=2.
3 is not in this sequence because the sum 3+A000120(3)=5 can also be obtained with value k=4, as also 4+A000120(4)=5.
		

Crossrefs

Sequence A228089 sorted into ascending order. Complement: A228236.
Cf. also A092391, A228085, A228088.

A228236 Numbers k for which a sum k+bitcount(k) can be also obtained as a sum k2 +bitcount(k2) for some other k2<>k . Here bitcount(k) (A000120) gives the number of 1's in binary representation of nonnegative integer k.

Original entry on oeis.org

3, 4, 11, 12, 14, 15, 16, 17, 19, 20, 27, 28, 29, 31, 32, 34, 35, 36, 43, 44, 46, 47, 48, 49, 51, 52, 59, 60, 62, 65, 67, 68, 75, 76, 78, 79, 80, 81, 83, 84, 91, 92, 93, 95, 96, 98, 99, 100, 107, 108, 110, 111, 112, 113, 115, 116, 123, 124, 125, 126, 127, 128
Offset: 1

Views

Author

Antti Karttunen, Aug 17 2013

Keywords

Comments

In other words, numbers k such that A228085(A092391(k)) > 1.

Examples

			0 is not in this sequence because the sum 0+A000120(0)=0 cannot be obtained with any other value of k than k=0.
1 is not in this sequence because the sum 1+A000120(1)=2 cannot be obtained with any other value of k than k=1.
2 is not in this sequence because the sum 2+A000120(2)=3 cannot be obtained with any other value of k than k=2.
3 IS in this sequence because the sum 3+A000120(3)=5 can also be obtained with value k=4, as also 4+A000120(4)=5, and thus also 4 is in this sequence.
		

Crossrefs

Complement: A228090. Subsets: A228091, A228237. Cf. also A092391, A228085.

A230297 a(n) = A010062(n) written in binary: a(n+1) = a(n) + hammingweight(a(n)) in binary.

Original entry on oeis.org

1, 10, 11, 101, 111, 1010, 1100, 1110, 10001, 10011, 10110, 11001, 11100, 11111, 100100, 100110, 101001, 101100, 101111, 110100, 110111, 111100, 1000000, 1000001, 1000011, 1000110, 1001001, 1001100, 1001111, 1010100, 1010111, 1011100, 1100000, 1100010, 1100101, 1101001, 1101101, 1110010, 1110110, 1111011, 10000001, 10000011
Offset: 0

Views

Author

N. J. A. Sloane, Oct 17 2013

Keywords

Comments

Is there any way to tell by looking at a binary number whether or not it is a term of this sequence?

Crossrefs

Cf. A010062.
Essentially the same as A157845.
Cf. A004207 (base-10 analog); A007088 (n in binary), A010062 (this written in base 10), A000120 (Hammingweight), A092391 (A000120(n) + n), A028897 (convert binary to decimal).

Programs

  • Mathematica
    s[0] = 1; s[n_] := s[n] = s[n-1] + DigitCount[s[n-1], 2, 1]; Table[FromDigits[IntegerDigits[s[n], 2]], {n, 0, 50}] (* Amiram Eldar, Jul 28 2023 *)
  • PARI
    (A230297(n)=A007088(A010062(n))); A230297_vec(N)={vector(N,i, if(i>1, A007088(N+=hammingweight(N)), N=1))} \\ M. F. Hasler, Nov 18 2019

Formula

a(n) = A157845(n+1) = A007088(A010062(n)) = A007088(A092391(A028897(a(n-1)))). - M. F. Hasler, Nov 18 2019

A157845 a(0) = 1, a(n) = sum of binary digits of all prior terms, expressed in binary.

Original entry on oeis.org

1, 1, 10, 11, 101, 111, 1010, 1100, 1110, 10001, 10011, 10110, 11001, 11100, 11111, 100100, 100110, 101001, 101100, 101111, 110100, 110111, 111100, 1000000, 1000001, 1000011, 1000110, 1001001, 1001100, 1001111, 1010100, 1010111, 1011100, 1100000, 1100010
Offset: 0

Views

Author

Oliver K. Seet, Mar 07 2009

Keywords

Comments

Equals A230297 = A010062 converted from decimal to binary, prefixed by another initial 1. - M. F. Hasler, Nov 18 2019

Crossrefs

Cf. A004207 (base-10 analog); A007088 (n in binary), A010062 (this written in base 10), A000120 (Hammingweight), A092391 (A000120(n) + n), A028897 (convert binary to decimal).

Programs

  • Maple
    b:= proc(n) option remember; `if`(n<2, 1, b(n-1)+
          add(i, i=convert(a(n-1), base, 10)))
        end:
    a:= n-> convert(b(n), binary):
    seq(a(n), n=0..44);  # Alois P. Heinz, Nov 18 2019
  • Mathematica
    s[0] = s[1] = 1; s[n_] := s[n] = s[n-1] + DigitCount[s[n-1], 2, 1]; Table[FromDigits[IntegerDigits[s[n], 2]], {n, 0, 50}] (* Amiram Eldar, Jul 28 2023 *)
  • PARI
    lista(nn) = {my(s = 1); my(t = 1); print1(t, ", "); for (i=1, nn, sb = binary(s); t = subst(Pol(sb), x, 10); print1(t, ", "); s += hammingweight(sb););}
    
  • PARI
    apply( A157845(n)=fromdigits(binary(A010062(n-!!n))), [0..40]) \\ M. F. Hasler, Nov 18 2019

Formula

a(n) = A230297(n-1) = A007088(A010062(n-1)) = A007088(A092391(A028897(a(n-1)))) for n > 0. - M. F. Hasler, Nov 18 2019

Extensions

a(11) corrected and extended by R. J. Mathar, Mar 12 2009
More terms from Michel Marcus, Apr 19 2014

A228089 Integers k for which a sum k + bitcount(k) cannot be obtained as a sum k2 + bitcount(k2) for any other k2<>k.

Original entry on oeis.org

0, 1, 2, 5, 6, 8, 7, 9, 10, 13, 18, 21, 22, 24, 23, 25, 26, 30, 33, 37, 38, 40, 39, 41, 42, 45, 50, 53, 54, 56, 55, 57, 58, 64, 61, 66, 63, 69, 70, 72, 71, 73, 74, 77, 82, 85, 86, 88, 87, 89, 90, 94, 97, 101, 102, 104, 103, 105, 106, 109, 114, 117, 118, 120, 119
Offset: 1

Views

Author

Antti Karttunen, Aug 17 2013

Keywords

Comments

The values of k's are sorted here according to the magnitude of the sum k + bitcount(k), where bitcount(k) (= A000120) gives the number of 1's in binary representation of nonnegative integer k; a(n) = A228086(A228088(n)).

Examples

			6 is in this sequence because the sum 6+A000120(6)=8 cannot be obtained with any other value of k than k=6.
8 is in this sequence because the sum 8+A000120(8)=9 cannot be obtained with any other value of k than k=8.
7 is in this sequence because the sum 7+A000120(7)=10 cannot be obtained with any other value of k than k=7.
In this sequence 8 becomes before 7 because 8+A000120(8) < 7+A000120(7).
		

Crossrefs

A228090 gives the same terms sorted into ascending order.

Programs

Formula

a(n) = A228086(A228088(n)).
A092391(a(n)) = A228088(n).

A228237 Numbers n for which there exists such a natural number k > n that k + bitcount(k) = n + bitcount(n), where bitcount(k) (A000120) gives the number of 1's in binary representation of nonnegative integer k.

Original entry on oeis.org

3, 11, 14, 15, 19, 27, 29, 31, 35, 43, 46, 47, 51, 59, 62, 67, 75, 78, 79, 83, 91, 93, 95, 99, 107, 110, 111, 115, 123, 124, 125, 126, 127, 131, 139, 142, 143, 147, 155, 157, 159, 163, 171, 174, 175, 179, 187, 190, 195, 203, 206, 207, 211, 219, 221, 223, 227
Offset: 1

Views

Author

Antti Karttunen, Sep 11 2013

Keywords

Comments

In other words, all such terms A228236(n) which satisfy A228236(n) < A228087(A092391(A228236(n))).
Note: 124 is the first term that occurs both here and in A228091.

Examples

			For cases 0 + A000120(0) = 0, 1 + A000120(1) = 2, 2 + A000120(2) = 3 there are no larger solutions yielding the same result.
However, for 3 + A000120(3) = 5 there is a larger solution yielding the same result, namely 4 + A000120(4) = 5, thus 3 is the first term of this sequence.
Next time this occurs for 11, as 11 + A000120(11) = 14 = 12 + A000120(12), and 12 > 11.
		

Crossrefs

Subset of A228236. Cf. also A228091.

A230300 a(n) = n + wt(n-1), where wt() = A000120() is the binary weight.

Original entry on oeis.org

1, 3, 4, 6, 6, 8, 9, 11, 10, 12, 13, 15, 15, 17, 18, 20, 18, 20, 21, 23, 23, 25, 26, 28, 27, 29, 30, 32, 32, 34, 35, 37, 34, 36, 37, 39, 39, 41, 42, 44, 43, 45, 46, 48, 48, 50, 51, 53, 51, 53, 54, 56, 56, 58, 59, 61, 60, 62, 63, 65, 65, 67, 68, 70, 66, 68, 69, 71, 71, 73, 74, 76, 75, 77, 78, 80, 80, 82, 83, 85, 83, 85
Offset: 1

Views

Author

N. J. A. Sloane, Oct 23 2013

Keywords

Comments

A228085(m-1) gives the number of times m occurs in this sequence.

Crossrefs

Cf. A000120, A092391, A228085, A230301 (complement).

Programs

  • Maple
    a:= n-> n+add(i,i=Bits[Split](n-1)):
    seq(a(n), n=1..82);  # Alois P. Heinz, Jul 05 2024
  • Mathematica
    Table[n+Total[IntegerDigits[n-1,2]],{n,100}] (* Harvey P. Dale, May 20 2015 *)
  • PARI
    a(n) = n + hammingweight(n-1); \\ Michel Marcus, Jul 05 2024

A320814 Approximation of the 2-adic integer exp(4) up to 2^n.

Original entry on oeis.org

0, 1, 1, 5, 13, 13, 13, 77, 77, 333, 333, 333, 333, 333, 333, 16717, 16717, 16717, 147789, 409933, 934221, 934221, 934221, 934221, 9322829, 9322829, 9322829, 9322829, 143540557, 411976013, 948846925, 948846925, 948846925, 948846925, 9538781517, 9538781517
Offset: 0

Views

Author

Jianing Song, Oct 21 2018

Keywords

Comments

In p-adic field, the exponential function exp(x) is defined as Sum_{k>=0} x^k/k!.
Let |x|A007814(x)%20be%20the%202-adic%20valuation%20of%20x.%20For%20any%202-adic%20number%20x,%20exp(x)%20=%20Sum">2 be the 2-adic metric of x, and v(x, 2) = A007814(x) be the 2-adic valuation of x. For any 2-adic number x, exp(x) = Sum{i>=0} x^i/i! converges implies that lim_{k->+oo} |x^k/k!|2 = 0, that is, lim{k->+oo} v(x^k/k!, 2) = +oo, or lim_{k->+oo} (k*(v(x, 2) - 1) + A000120(i)) = +oo. So v(x, 2) > 1, x is a 2-adic integer divisible by 4. On the other hand, for any integer n and i >= A320840(n), v(4^i/i!, 2) = A092391(i) >= n, so approximation of exp(4) up to 2^n is wholly determined by Sum_{i=0..A320840(n)-1} 4^i/i! (see formula section below), which is well-defined because it has only finitely many terms.
When extended to a function over the metric completion of the p-adic field, exp(x) has radius of convergence p^(-1/(p-1)).
a(n) is the multiplicative inverse of A321689(n) modulo 2^n. - Jianing Song, Nov 17 2018

Examples

			A320840(1) = 1, 4^0/0! = 1, so a(1) = 1.
A320840(4) = 3, Sum_{i=0..2} 4^i/i! = 13, so a(4) = 13.
A320840(6) = 5, Sum_{i=0..4} 4^i/i! = 103/3 == 13 (mod 64), so a(6) = 13.
A320840(8) = 6, Sum_{i=0..5} 4^i/i! = 643/15 == 77 (mod 256), so a(8) = 77.
A320840(9) = 7, Sum_{i=0..6} 4^i/i! = 437/9 == 333 (mod 512), so a(9) = 333.
		

Crossrefs

Programs

  • PARI
    a(n) = lift(sum(i=0, n-1-(n>=2), Mod(4^i/i!, 2^n)))
    
  • PARI
    a(n) = lift(exp(4 + O(2^n))); \\ Andrew Howroyd, Nov 05 2018

Formula

If Sum_{i=0..A320840(n)-1} 4^i/i! = p/q, gcd(p, q) = 1, then a(n) = p*q^(-1) mod 2^n.
a(n) = Sum_{i=0..n-1} A320815(i)*2^i.

A348367 a(n) = w(n + w(n)), where w(n) is the binary weight of n, A000120(n).

Original entry on oeis.org

1, 2, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 1, 2, 3, 2, 3, 2, 3, 3, 2, 3, 4, 3, 3, 4, 5, 5, 2, 2, 2, 2, 3, 2, 3, 3, 2, 3, 4, 3, 3, 4, 5, 5, 3, 3, 3, 3, 3, 4, 5, 5, 4, 4, 4, 5, 5, 5, 1, 1, 2, 3, 3, 2, 3, 2, 3, 3, 2, 3, 4, 3, 3, 4, 5, 5, 3, 3, 3, 3, 3, 4, 5, 5, 4, 4, 4, 5, 5, 5, 2, 2, 3, 4, 4, 3, 3, 4, 5
Offset: 1

Views

Author

Ctibor O. Zizka, Oct 15 2021

Keywords

Examples

			n = 5; a(5) = A000120(5 + A000120(5)) = 3.
		

Crossrefs

Programs

  • Mathematica
    h[n_] := DigitCount[n, 2, 1]; a[n_] := h[n + h[n]]; Array[a, 100] (* Amiram Eldar, Oct 15 2021 *)
  • PARI
    a(n) = hammingweight(n + hammingweight(n)); \\ Michel Marcus, Oct 17 2021
  • Python
    def h(n): return bin(n).count('1')
    def a(n): return h(n + h(n))
    print([a(n) for n in range(1, 100)]) # Michael S. Branicky, Oct 15 2021
    

Formula

a(n) = A000120(n + A000120(n)); a(n) = A000120(A092391(n)).

A350229 a(n) is the sum of n and the balanced ternary digits in n.

Original entry on oeis.org

0, 2, 2, 4, 6, 4, 6, 8, 8, 10, 12, 12, 14, 16, 12, 14, 16, 16, 18, 20, 20, 22, 24, 22, 24, 26, 26, 28, 30, 30, 32, 34, 32, 34, 36, 36, 38, 40, 40, 42, 44, 38, 40, 42, 42, 44, 46, 46, 48, 50, 48, 50, 52, 52, 54, 56, 56, 58, 60, 58, 60, 62, 62, 64, 66, 66, 68
Offset: 0

Views

Author

Rémy Sigrist, Jan 09 2022

Keywords

Comments

The image of this sequence is the set of nonnegative even numbers (A005843).

Examples

			For n = 42:
- the balanced ternary representation of 42 is "1TTT0",
- so a(42) = 42 + 1 - 1 - 1 - 1 + 0 = 40.
		

Crossrefs

See A062028, A092391, A230641 for similar sequences.
Cf. A005843, A065363, A174658 (fixed points).

Programs

  • Mathematica
    Array[# + Total[If[First@ # == 0, Rest@ #, #] &[Prepend[IntegerDigits[#, 3], 0] //. {x___, y_, k_ /; k > 1, z___} :> {x, y + 1, k - 3, z}]] &, 70, 0] (* Michael De Vlieger, Jan 15 2022 *)
  • PARI
    a(n) = my (v=n, d); while (n, n=(n-d=[0,1,-1][1+n%3])/3; v+=d); v

Formula

a(n) = n + A065363(n).
a(n) = n iff n belongs to A174658.
Previous Showing 21-30 of 38 results. Next