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 31-39 of 39 results.

A151976 Minimal recursive sequence beginning with 5 similar to N with respect to property of integer to be or not to be in A079523.

Original entry on oeis.org

5, 6, 8, 10, 13, 14, 17, 18, 21, 22, 24, 26, 29, 30, 32, 34, 37, 38, 40, 42, 45, 46, 49, 50, 53, 54, 56, 58, 61
Offset: 1

Views

Author

Vladimir Shevelev, Jul 12 2009

Keywords

Examples

			a(2)=6 since 6>5 is the minimal integer such that 2 and 6 simultaneously are not in A079523.
		

Crossrefs

Formula

For n>=1, a(n+1)=min{m>a(n): A035263(m)=A035263(n+1)}

A294991 Let S be the sequence of integer sets defined by the following rules: S(0) = {0}, S(1) = {1} and for any k > 0, S(2*k) = {2*k} U S(k) and S(2*k+1) = {2*k+1} U S(k) U S(k+1) (where X U Y denotes the union of the sets X and Y); a(n) = the number of elements of S(n).

Original entry on oeis.org

1, 1, 2, 3, 3, 4, 4, 5, 4, 6, 5, 6, 5, 7, 6, 7, 5, 8, 7, 8, 6, 8, 7, 8, 6, 9, 8, 9, 7, 9, 8, 9, 6, 10, 9, 10, 8, 10, 9, 10, 7, 10, 9, 10, 8, 10, 9, 10, 7, 11, 10, 11, 9, 11, 10, 11, 8, 11, 10, 11, 9, 11, 10, 11, 7, 12, 11, 12, 10, 12, 11, 12, 9, 12, 11, 12, 10
Offset: 0

Views

Author

Rémy Sigrist, Nov 12 2017

Keywords

Comments

For any n >= 0, a(n) corresponds the number of calls to the "fusc" function (defined by Dijkstra) required to compute A002487(n) with an implementation using memoization, and starting with an empty cache.
The sequence A215673 corresponds to the variant without memoization.
For any n > 0, a(n) <= A215673(n) (with equality iff n is a power of 2).
The scatterplot of the ordinal transform of the sequence shows a network of broken lines.
Also: for n >= 1, a(n)+2 is the number of states in the minimal complete deterministic finite automaton that accepts the base-2 representation of m and m+n in parallel, starting with the most significant digit. - Jeffrey Shallit, Jul 22 2023

Examples

			The first terms, alongside the corresponding set S(n), are:
n   a(n)    S(n)
--  ----    -----
0   1       { 0 }
1   1       { 1 }
2   2       { 1, 2 }
3   3       { 1, 2, 3 }
4   3       { 1, 2, 4 }
5   4       { 1, 2, 3, 5 }
6   4       { 1, 2, 3, 6 }
7   5       { 1, 2, 3, 4, 7 }
8   4       { 1, 2, 4, 8 }
9   6       { 1, 2, 3, 4, 5, 9 }
10  5       { 1, 2, 3, 5, 10 }
11  6       { 1, 2, 3, 5, 6, 11 }
12  5       { 1, 2, 3, 6, 12 }
13  7       { 1, 2, 3, 4, 6, 7, 13 }
14  6       { 1, 2, 3, 4, 7, 14 }
15  7       { 1, 2, 3, 4, 7, 8, 15 }
16  5       { 1, 2, 4, 8, 16 }
17  8       { 1, 2, 3, 4, 5, 8, 9, 17 }
18  7       { 1, 2, 3, 4, 5, 9, 18 }
19  8       { 1, 2, 3, 4, 5, 9, 10, 19 }
20  6       { 1, 2, 3, 5, 10, 20 }
See also illustration of the first terms in Links section.
		

Crossrefs

Programs

  • PARI
    a(n) = my (S = Set(n), u = 1); while (u <= #S, my (v = S[#S-u+1]); if (v>1, if (v%2==0, S = setunion(S, Set(v/2)), S = setunion(S, Set([(v-1)/2, (v+1)/2])))); u++;); return (#S)

Formula

a(n) = 2*floor(log_2 n) - nu_2(n) + [n is a power of 2] + [1st two bits of n in base 2 are 11] = 2*A000523(n) - A007814(n) + A209229(n) + [n belongs to A004755], for n >= 1. - Jeffrey Shallit, Jul 20 2023
a(2*n) = a(n) + 1, n >= 1.
a(4*n+1) = a(2*n+1)+2, n >= 2.
a(4*n+3) = a(2*n+1)+2, n >= 0.
a(2^k) = k + 1 for any k >= 0.
Empirically: a(2*k-1) = 2*A070939(k) - 2*A209229(k) + [(k-1) is in A004760] for any k > 0 (where [P]=1 if P is true and [P]=0 otherwise).

A295897 Numbers in whose binary expansion there are no 1-runs of odd length followed by a 0 to their right.

Original entry on oeis.org

0, 1, 3, 6, 7, 12, 13, 15, 24, 25, 27, 30, 31, 48, 49, 51, 54, 55, 60, 61, 63, 96, 97, 99, 102, 103, 108, 109, 111, 120, 121, 123, 126, 127, 192, 193, 195, 198, 199, 204, 205, 207, 216, 217, 219, 222, 223, 240, 241, 243, 246, 247, 252, 253, 255, 384, 385, 387, 390, 391, 396, 397, 399, 408, 409, 411, 414, 415, 432
Offset: 1

Views

Author

Antti Karttunen, Dec 01 2017

Keywords

Comments

No runs of 1-bits of odd length allowed in the binary expansion of n (A007088), except that when n is an odd number, then the rightmost run may have an odd length. Subsequence A277335 does not allow that exception.
A005940(1+a(n)) yields a permutation of A028982, squares and twice squares.
Running maximum without repetition of the decimal equivalent of Gray code for n (A003188). - Frédéric Nouvier, Aug 14 2020

Crossrefs

Subsequence of A004760.
Cf. A277335 (a subsequence).
Cf. A295896 (characteristic function).

Programs

  • Python
    [x ^ (x>>1) for x in range(0,2048) if (x & (x<<1) == 0)]
    # Frédéric Nouvier, Aug 14 2020
    
  • Python
    def A295897(n):
        tlist, s = [1,2], 0
        while tlist[-1]+tlist[-2] <= n: tlist.append(tlist[-1]+tlist[-2])
        for d in tlist[::-1]:
            s <<= 1
            if d <= n:
                s += 1
                n -= d
        return s>>1^s # Chai Wah Wu, Apr 25 2025
  • Rust
    fn main() {
        for i in (0..2048)
            // Filter to get A003714
            .filter(|n| n & (n << 1) == 0)
            // Map to produce A295897
            .map(|n| n ^ (n >> 1))
        {
            println!("{}", i);
        }
    } // Frédéric Nouvier, Aug 14 2020
    

Formula

a(n) = A003714(n-1) XOR ( A003714(n-1) >> 1 ). - Frédéric Nouvier, Aug 14 2020

A380558 G.f. A(x) satisfies A(x - A(x)) = x^2/(1 - x^2).

Original entry on oeis.org

1, 2, 10, 62, 469, 4028, 37984, 385202, 4144798, 46882400, 553733875, 6795347708, 86314711993, 1131422763410, 15268625617174, 211726229534738, 3012057754693912, 43903115899714844, 654923002676505376, 9989373316478767304, 155663132037403882606, 2476418549848925209424, 40195761790035415573939
Offset: 2

Views

Author

Paul D. Hanna, Feb 13 2025

Keywords

Comments

Conjecture: a(n) is odd iff n = 2*A004760(k) for some k > 1, where A004760 lists numbers whose binary expansion does not begin 10.

Examples

			G.f.: A(x) = x^2 + 2*x^3 + 10*x^4 + 62*x^5 + 469*x^6 + 4028*x^7 + 37984*x^8 + 385202*x^9 + 4144798*x^10 + 46882400*x^11 + 553733875*x^12 + ...
where A(x - A(x)) = x^2/(1 - x^2).
Let B(x) = Series_Reversion(x - A(x)), where
B(x) = x + x^2 + 4*x^3 + 25*x^4 + 190*x^5 + 1645*x^6 + 15652*x^7 + 160186*x^8 + 1739032*x^9 + 19838179*x^10 + ... + A380678(n)*x^n + ...
then B(x) = x + A(B(x)).
		

Crossrefs

Programs

  • PARI
    /* Generates N terms of this sequence */
    N = 40; A=x^2; for(m=1,N, A=truncate(A); B = serreverse(x - A +x*O(x^m)); A = B^2/(1-B^2) ); Vec(A)

Formula

G.f. A(x) = Sum_{n>=2} a(n)*x^n satisfies the following formulas.
(1) A(x - A(x)) = x^2/(1 - x^2).
(2) A(x) = B(x)^2/(1 - B(x)^2) where B(x) = x + A(B(x)) and B(x - A(x)) = x.
(3) A(x) = B(x)^2/(1 - B(x)^2) where B(x) = x + Sum_{n>=1} d^(n-1)/dx^(n-1) A(x)^n / n!.

A051464 Number of divisors of 4*(2^n-1) + 1.

Original entry on oeis.org

2, 2, 2, 2, 4, 4, 2, 2, 4, 2, 4, 2, 4, 6, 4, 4, 16, 2, 4, 2, 4, 2, 4, 8, 12, 8, 2, 4, 8, 4, 4, 4, 4, 4, 4, 8, 8, 4, 8, 16, 8, 4, 8, 8, 6, 16, 8, 8, 8, 16, 8, 4, 32, 32, 8, 4, 8, 4, 4, 8, 16, 8, 8, 16, 48, 16, 16, 8, 4, 16, 4, 16, 16, 8, 8, 8, 16, 16, 8, 16, 32
Offset: 1

Views

Author

Edwin D. Evans, eevans2(AT)pacbell.net

Keywords

Comments

Create a table with tau(2^n-1) as the first row (A046801) and tau(m) as the first column (A000005). The second column is tau(A004760) and so on. Rows 2, 3 and 4 are easily described in terms of row 1. This sequence is row 5.

Crossrefs

Programs

  • Mathematica
    Array[DivisorSigma[0, 4*(2^# - 1) + 1] &, 81] (* Michael De Vlieger, Sep 15 2021 *)
  • PARI
    a(n) = numdiv(4*(2^n-1) + 1); \\ Michel Marcus, Sep 16 2021

Formula

a(n) = tau(4*(2^n -1)+1), where d(n) = A000005(n).

Extensions

a(81) corrected by Sean A. Irvine, Sep 15 2021

A294523 Lexicographically earliest sequence of positive terms, such that, for any n > 0, the binary expansion of n, say of size k+1, is (1, a(n) mod 2, a^2(n) mod 2, ..., a^k(n) mod 2) (where a^i denotes the i-th iterate of the sequence).

Original entry on oeis.org

1, 2, 1, 2, 6, 5, 1, 2, 10, 6, 14, 9, 5, 13, 1, 2, 18, 10, 22, 12, 6, 14, 30, 17, 9, 5, 11, 25, 13, 29, 1, 2, 34, 18, 38, 20, 10, 22, 46, 24, 12, 6, 54, 28, 14, 30, 62, 33, 17, 9, 19, 41, 5, 11, 23, 49, 25, 13, 27, 57, 29, 61, 1, 2, 66, 34, 70, 36, 18, 38, 78
Offset: 1

Views

Author

Rémy Sigrist, Nov 01 2017

Keywords

Comments

More informally, the parity of the iterate of the sequence at n gives the binary expansion of n (beyond the leading 1).
Apparently, iterating the sequence always leads to one of these three loops:
- the fixed point (1) iff we start from 2^k-1 for some k > 0,
- the fixed point (2) iff we start from 2^k for some k > 0,
- or (5, 6) for any other starting value.
a(n) is even iff n belongs to A004754.
a(n) is odd iff n belongs to A004760.
If a(n) > n then a(n) = A080541(n).
If n < 2^k then a(n) < 2^k.
Apparently, if a(n) > 2, then A054429(a(n)) = a(A054429(n)); this accounts for the symmetry of the part connected to the loop (5,6) in the oriented graph of this sequence.

Examples

			For n=11:
- the binary representation of 11 is (1,0,1,1),
- a(11) = 14 has parity 0,
- a(14) = 13 has parity 1,
- a(13) = 5 has parity 1,
- we find the binary digits of 11 beyond the initial 1, in order: 0, 1, 1.
See also representations of first terms in Links section.
		

Crossrefs

Programs

  • PARI
    See Links section.

Formula

a(n) = 1 iff n = A000225(k) for some k > 0.
a(n) = 2 iff n = A000079(k) for some k > 0.
a(n) = 5 iff n = A081254(k) for some k > 2.
a(n) = 6 iff n = A000975(k) for some k > 2.
a(n) = 10 iff n = A081253(k) for some k > 2.
a(n) = 12 iff n = A266613(k) for some k > 3.
a(n) = 13 iff n = A052997(k) for some k > 2.
a(n) = 14 iff n = A266721(k) for some k > 2.
a(n) = 18 iff n = A267045(k) for some k > 3.
a(n) = 54 iff n = A266248(k) for some k > 4.
These formulas come from the fact that each sequence on the right side, say f, eventually satisfies: f(n) = floor(f(n+1)/2), and f(n) and f(n+2) have the same parity.

A375378 Value of the power tower formed by the numbers in the n-th composition (in standard order).

Original entry on oeis.org

1, 1, 2, 1, 3, 2, 1, 1, 4, 3, 4, 2, 1, 1, 1, 1, 5, 4, 9, 3, 8, 4, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 6, 5, 16, 4, 27, 9, 3, 3, 16, 8, 16, 4, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 7, 6, 25, 5, 64, 16, 4, 4, 81, 27, 81, 9, 3, 3, 3, 3, 32, 16
Offset: 0

Views

Author

Pontus von Brömssen, Aug 14 2024

Keywords

Comments

It is natural to define a(0) = 1.

Examples

			For n = 38, the 38th composition is (3,1,2), so a(38) = 3^1^2 = 3^1 = 3.
		

Crossrefs

Cf. A004760, A053645, A065120, A066099 (compositions in standard order), A375379.

Formula

a(n) = A065120(n)^a(A053645(n)) for n >= 1.
a(n) = 1 if and only if A065120(n) <= 1, i.e., if and only if n is in A004760.

A383593 In the binary expansion of n, change the most significant 0 bit to 1, if there is any 0 bit.

Original entry on oeis.org

1, 1, 3, 3, 6, 7, 7, 7, 12, 13, 14, 15, 14, 15, 15, 15, 24, 25, 26, 27, 28, 29, 30, 31, 28, 29, 30, 31, 30, 31, 31, 31, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 56, 57, 58, 59, 60, 61, 62, 63, 60, 61, 62, 63, 62, 63, 63, 63, 96, 97, 98, 99, 100
Offset: 0

Views

Author

Keywords

Comments

n = 0 is taken to be a single 0 bit, but for all other n no leading 0 bits are used.
The plot of the sequence is fractal.

Examples

			a(25) = 29 since 25 = 11001_2 becomes 11101_2 = 29.
		

Crossrefs

Cf. A000225 (fixed points), A004760 (range of values), A063250.

Programs

  • Python
    def a(n): return int(bin(n)[2:].replace('0', '1', 1), 2)
    print([a(n) for n in range(70)]) # Michael S. Branicky, Jun 11 2025
    
  • Python
    def A383593(n): return (n if (t:=bin(n)[2:].find('0'))==-1 else n+(1<Chai Wah Wu, Jun 17 2025

Formula

a(n) = n + floor(2^(A063250(n)-1)) for n > 0. - David Radcliffe, Jun 12 2025

A151994 For k=A079523(n),n>=2, let {S_k} be the minimal recursive sequence beginning with k similar to N with respect to property of integer to be or not to be in A079523. Then a(n) is the point of confluence of {S_k} with {S_5}.

Original entry on oeis.org

5, 13, 13, 29, 29, 61, 61, 61, 61
Offset: 2

Views

Author

Vladimir Shevelev, Jul 12 2009

Keywords

Examples

			Note that, {S_5} is {5,6,8,10,13,...}(see A162736) and {S_7} is {7,8,10,11,13,...}, then a(3)=13.
		

Crossrefs

Previous Showing 31-39 of 39 results.