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

A060477 Number of orbits of length n in map whose periodic points are A000051.

Original entry on oeis.org

3, 1, 2, 3, 6, 9, 18, 30, 56, 99, 186, 335, 630, 1161, 2182, 4080, 7710, 14532, 27594, 52377, 99858, 190557, 364722, 698870, 1342176, 2580795, 4971008, 9586395, 18512790, 35790267, 69273666, 134215680, 260300986, 505286415, 981706806, 1908866960, 3714566310
Offset: 1

Views

Author

Keywords

Examples

			a(3)=2 since the 3rd term of A000051 is 9 and the first term is 3.
		

Crossrefs

Cf. A000051.
Cf. A001037, A059966 (both nearly identical to this sequence).
Cf. A093210.

Programs

  • PARI
    a000051(n) = 2^n+1;
    a(n) = (1/n)*sumdiv(n, d, moebius(d)*a000051(n/d)); \\ Michel Marcus, Sep 11 2017
    
  • Python
    from sympy import mobius, divisors
    def A060477(n): return sum(mobius(n//d)*(2**d+1) for d in divisors(n,generator=True))//n # Chai Wah Wu, Feb 03 2022

Formula

a(n) = (1/n)* Sum_{d|n} mu(d)*A000051(n/d).

Extensions

A048578 replaced by A000051 in name and formula by Michel Marcus, Sep 11 2017

A078830 Numbers having in binary representation exactly one binary substring representing a prime.

Original entry on oeis.org

2, 3, 4, 8, 9, 16, 32, 33, 64, 65, 128, 129, 256, 512, 513, 1024, 1025, 2048, 2049, 4096, 4097, 8192, 8193, 16384, 16385, 32768, 32769, 65536, 131072, 131073, 262144, 262145, 524288, 524289, 1048576, 1048577, 2097152, 2097153, 4194304, 4194305
Offset: 1

Views

Author

Reinhard Zumkeller, Dec 08 2002

Keywords

Comments

A078827(a(n)) = 1; subsequence of A078829 and of A078831;
for k>2 also floor(a(k)/2) belongs to the sequence.

Examples

			p=2 -> '10' is the only prime contained exactly once in 2^k, k>0.
		

Crossrefs

Extensions

Extended by Ray Chandler, Nov 03 2008

A143096 a(n) = 2*a(n-1)-1, with a(1)=1, a(2)=4, a(3)=5.

Original entry on oeis.org

1, 4, 5, 9, 17, 33, 65, 129, 257, 513, 1025, 2049, 4097, 8193, 16385, 32769, 65537, 131073, 262145, 524289, 1048577, 2097153, 4194305, 8388609, 16777217, 33554433, 67108865, 134217729, 268435457, 536870913, 1073741825, 2147483649, 4294967297, 8589934593
Offset: 1

Views

Author

Gary W. Adamson and Roger L. Bagula, Jul 23 2008

Keywords

Examples

			a(4) = 9 = 2*a(3) - 1 = 2*5 - 1.
a(4) = 9 = (1, 3, 3, 1) dot (1, 3, -2, 5) = (1 + 9 - 6 + 5).
		

Crossrefs

Cf. A065190.
Essentially the same as A083318, A048578 and A000051.

Programs

  • Mathematica
    Join[{1,4},NestList[2#-1&,5,40]] (* or *) Join[{1,4},LinearRecurrence[ {3,-2},{5,9},40]] (* Harvey P. Dale, Feb 18 2014 *)

Formula

Binomial transform of 0, 1, 2, -4, 9, -13, 20, -26, 35, ... (offset 0).
O.g.f.: x*(1+x-5*x^2+2*x^3)/((1-x)*(1-2*x)). a(n) = 1+2^(n-1), n>2. - R. J. Mathar, Jul 31 2008
a(n) = A048578(n-2), n>=3. - R. J. Mathar, Aug 10 2008

A345254 Dispersion of A004754, a rectangular array T(n,k) read by downward antidiagonals.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 8, 9, 10, 7, 16, 17, 18, 11, 12, 32, 33, 34, 19, 20, 13, 64, 65, 66, 35, 36, 21, 14, 128, 129, 130, 67, 68, 37, 22, 15, 256, 257, 258, 131, 132, 69, 38, 23, 24, 512, 513, 514, 259, 260, 133, 70, 39, 40, 25, 1024, 1025, 1026, 515, 516, 261, 134
Offset: 1

Views

Author

J. Parker Shectman, Jun 12 2021

Keywords

Comments

As a sequence, {a(n)} permutes the positive integers. As an array, {T(n,k)} is an interspersion-dispersion or I-D array (refer to Kimberling, 1st linked reference).
The top row of {T(n,k)} is A000079 or powers of two = 1, 2, 4, 8, 16, ....
Except for the leftmost element "1" of the top row, rows of T(n,k) indexed n = 0, 1, 2, ..., consist entirely of even numbers (A005843) for n even and entirely of odd numbers (A005408) for n odd.
The left column (k = 1) of {T(n,k)} comprises a "1" for the top row (n = 0) and A004755(n) = n + 2^(floor(log_2(n)) + 1), for rows n = 1, 2, 3, ....
For rows indexed n = 0, 1, 2, ..., and columns indexed k = 1, 2, 3, ..., T(n,k) is given by T(0,k) = L^(k - 1)(1) and T(n,k) = L^(k - 1) R(n) for n = 1, 2, 3, ..., the image of n under a composition of branching functions L(n) = A004754(n) = n + 2^floor(log_2(n)) and R(n) = A004755(n) = n + 2^(floor(log_2(n)) + 1) (cf. generating tree A059893 and 2nd linked reference).
(Duality with array A054582): Consider A059893 and A000027 as labeled binary trees arranging the positive integers. In latter tree, node labels equal node positions, thus following their natural order. Rows of {T(n,k)} are the labels along maximal straight paths that always branch left in the former tree, while rows of (transposed) array A054582 are the labels along maximal straight paths that always branch left in the latter tree.
Column k of {T(n,k)} comprises the (sorted) labels in the k-th right clade of latter tree, while column k of (transposed) A054582 comprises the (sorted) labels in the k-th right clade of the former tree. This makes the arrays {T(n,k)} and (transposed) A054582 "blade-duals," blade being a contraction of branch-clade ('right clades' explained under tree A345253 and in 2nd link).
Write the positive integers in natural order as a (left-justified) "tetrangle" or "irregular triangle" tableau with 2^t entries on each row t, for t=1, 2, 3, .... Then, columns of the tableau equal rows of {T(n,k)} (2nd link):
1,
2, 3,
4, 5, 6, 7,
8, 9, 10, 11, 12, 13, 14, 15
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
...
Analogous to A345252, its right-justified tableau of the positive integers in cohorts with lengths the Fibonacci numbers replaced by the above left-justified tableau with powers of two as lengths of the cohorts.
(Mirror duality): A "mirror dual" I-D array or "inverse I-D array" (see Kimberling, 1st linked reference) is obtained by substituting the left-justified tableau by a right-justified tableau and following the identical procedure, or equivalently by mirroring the tree A059893 cited above, i.e., taking maximal straight paths that always branch right in the tree A059893. With two types of duality then, {T(n,k)} forms a quartet of I-D arrays together with its mirror dual, its blade dual (transposed) A054582 and mirror dual A191448 of the latter.
(Para-sequences): Sequences of row and column indices (see Conway-Sloane correspondence under A019586, citing Kimberling). For rows indexed n = 0, 1, 2, ..., and columns indexed k = 1, 2, 3, ..., the row index n of positive integer T(n,k) is A053645(T) and the column index k of positive integer T(n,k) is A065120(T).

Examples

			Northwest corner of {T(n,k)}:
       k=1   k=2    k=3     k=4      k=5       k=6
  n=0:   1,    2,     4,      8,      16,       32, ...
  n=1:   3,    5,     9,     17,      33,       65, ...
  n=2:   6,   10,    18,     34,      66,      130, ...
  n=3:   7,   11,    19,     35,      67,      131, ...
  n=4:  12,   20,    36,     68,     132,      260, ...
  ...
Northwest corner of {T(n,k)} in base-2:
        k=1  k=2    k=3     k=4      k=5       k=6
  n=0:  1,   10,    100,    1000,    10000,    100000, ...
  n=1:  11,  101,   1001,   10001,   100001,   1000001, ...
  n=2:  110, 1010,  10010,  100010,  1000010,  10000010, ...
  n=3:  111, 1011,  10011,  100010,  1000011,  10000011, ...
  n=4:  1100,10100, 100100, 1000100, 10000100, 100000100, ...
  ...
		

Crossrefs

Programs

  • Mathematica
    (*Simplified Formula*)
    MatrixForm[Prepend[Table[n + 2^(Floor[Log[2, n]] + k), {n, 1, 4}, {k, 1, 6}], Table[2^(k - 1), {k, 1, 6}]]]
    (*Branching Formula*)
    MatrixForm[Prepend[Table[NestList[Function[# + 2^(Floor[Log[2, #]])], n + 2^(Floor[Log[2, n]] + 1), 5], {n, 1, 4}], NestList[Function[# + 2^(Floor[Log[2, #]])], 1, 5]]]
  • PARI
    T(n, k) = if (n==0, 2^(k-1), n + 2^(log(n)\log(2) + k));
    matrix(7, 7, n, k, n--; T(n, k)) \\ Michel Marcus, Jul 30 2021

Formula

T(0,k) = 2^(k - 1) and T(n,k) = n + 2^(floor(log_2(n)) + k) for n >= 1.
T(0,k) = L^(k - 1)(1) and T(n,k) = L^(k - 1) R(n) for n = 1, 2, 3, ..., where L(n) = A004754(n) = n + 2^floor(log_2(n)) and R(n) = A004755(n) = n + 2^(floor(log_2(n)) + 1).
Let b(n) = A054582(n-1). Then for all n >= 1, a(n) = A139706(b(n)) and b(n) = A139708(a(n)).

A380728 For n a power of 2, a(n) = n. Otherwise a(n) is the smallest number not yet in the sequence which is coprime to n and has the same binary weight as n.

Original entry on oeis.org

1, 2, 5, 4, 3, 17, 11, 8, 10, 9, 7, 65, 14, 13, 23, 16, 6, 257, 21, 33, 19, 25, 15, 1025, 22, 35, 29, 37, 27, 43, 47, 32, 20, 129, 26, 4097, 28, 41, 46, 513, 38, 67, 30, 49, 53, 39, 31, 16385, 44, 69, 58, 73, 45, 71, 59, 81, 77, 51, 55, 83, 62, 61, 95, 64, 12
Offset: 1

Views

Author

David James Sycamore, Jan 31 2025

Keywords

Comments

Self inverse sequence with fixed points on powers of 2 (similar to A005940). Records subsequence (after 1,2) set by odd numbers with binary weight = 2 (see A000051, for n >= 2, and also A048578).
Conjectured to be a permutation of the natural numbers (primes not in order).

Examples

			a(1) = 1, the smallest novel number coprime to 1 and having same binary weight (1)
a(3) = 5, since weight(3) = weight(5) = 2 and gcd(2,5) = 1, and 5 is least such number.
a(5) = 3 (sequence is self inverse).
		

Crossrefs

Programs

  • Mathematica
    nn = 2^13; c[_] := False; u = 1;
    f[x_] := f[x] = DigitCount[x, 2, 1];
    Reap[Do[w = f[n];
      Which[w == 1, k = n,
        And[w == 2, EvenQ[n]],
          k = 3; While[Or[c[k], ! CoprimeQ[k, n]], k = 2*(k - 1) + 1],
        True, k = u; While[Or[c[k], ! CoprimeQ[k, n], w != f[k]], k++] ];
      Sow[k]; c[k] = True;
    If[k == u, While[c[u], u++]], {n, nn}] ][[-1, 1]] (* Michael De Vlieger, Feb 02 2025 *)

Formula

a(a(n)) = n for all n.

Extensions

More terms from Michael De Vlieger, Feb 02 2025.
Showing 1-5 of 5 results.