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-2 of 2 results.

A386569 The number of binary self numbers not exceeding 2^n.

Original entry on oeis.org

1, 1, 2, 3, 5, 10, 18, 34, 67, 131, 261, 520, 1037, 2073, 4143, 8283, 16562, 33121, 66237, 132471, 264938, 529870, 1059740, 2119473, 4238941, 8477878, 16955748, 33911492, 67822978, 135645949, 271291894, 542583782, 1085167557, 2170335106, 4340670206, 8681340402
Offset: 0

Views

Author

Amiram Eldar, Jul 26 2025

Keywords

Examples

			There are 3 binary self numbers that do no exceed 2^3 = 8: 1, 4 and 6. Hence a(3) = 3.
		

Crossrefs

Programs

  • Mathematica
    selfQ[n_] := AllTrue[Range[n, n - Floor@Log2[n], -1], # + DigitCount[#, 2, 1] != n &]; a[n_] := Count[Range[2^n], _?selfQ]; Array[a, 16, 0]

Formula

Limit_{n->oo} a(n)/2^n = A242403.

A337079 The number of twin binary Niven numbers (k, k+1) such that k <= 2^n.

Original entry on oeis.org

1, 1, 1, 1, 2, 2, 5, 8, 18, 35, 61, 98, 187, 304, 492, 880, 1583, 2779, 5196, 9407, 17387, 31772, 58450, 106360, 193875, 351836, 642844, 1173333, 2155913, 3993379, 7466547, 14048253, 26680668, 50751057, 97052665, 185557893, 354235368, 674995568, 1284856970
Offset: 1

Views

Author

Amiram Eldar, Aug 14 2020

Keywords

Examples

			a(5) = 2 since there are two binary Niven numbers k below 2^5 = 32 such that k+1 is also a binary Niven number: 1 and 20.
		

Crossrefs

Programs

  • Mathematica
    binNivenQ[n_] := Divisible[n, DigitCount[n, 2, 1]]; s = {}; c = 0; p = 2; q1 = True; Do[q2 = binNivenQ[n]; If[q1 && q2, c++]; If[n - 1 == p, AppendTo[s, c]; p *= 2]; q1 = q2, {n, 2, 2^20}]; s

Formula

a(n) ~ c * 2^n/n^2, where c is a constant (consequence of the theorem of De Koninck et al., 2008). Apparently c ~ 0.28.
Showing 1-2 of 2 results.