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 11-13 of 13 results.

A358631 Irregular table T(n, k), n >= 0, k > 0, read by rows of extended (due to binary expansion of n) Stirling numbers of the first kind.

Original entry on oeis.org

1, 1, 2, 3, 1, 4, 5, 1, 6, 11, 6, 1, 6, 7, 1, 12, 20, 9, 1, 18, 26, 9, 1, 24, 50, 35, 10, 1, 8, 9, 1, 18, 29, 12, 1, 30, 41, 12, 1, 48, 94, 59, 14, 1, 36, 47, 12, 1, 72, 130, 71, 14, 1, 96, 154, 71, 14, 1, 120, 274, 225, 85, 15, 1, 10, 11, 1, 24, 38, 15, 1, 42
Offset: 0

Views

Author

Mikhail Kurkov, Nov 24 2022

Keywords

Comments

Row n length is A000120(n) + 2.

Examples

			Irregular table begins:
    1,   1;
    2,   3,   1;
    4,   5,   1;
    6,  11,   6,  1;
    6,   7,   1;
   12,  20,   9,  1;
   18,  26,   9,  1;
   24,  50,  35, 10,  1;
    8,   9,   1;
   18,  29,  12,  1;
   30,  41,  12,  1;
   48,  94,  59, 14,  1;
   36,  47,  12,  1;
   72, 130,  71, 14,  1;
   96, 154,  71, 14,  1;
  120, 274, 225, 85, 15, 1;
		

Crossrefs

Programs

  • PARI
    b1(n)=if(n>0, my(A=n - 2^logint(n, 2)); if(A>0, logint(A, 2) + 1))
    b2(n)=if(n>0, my(A=b1(3*2^logint(n, 2) - n - 1)); n + if(A>0, 2^(A-1)))
    P(n,k)=if(n==0 || k==1, (n==0 && k<3) + (k==1 && n>0), my(L=logint(n, 2), A=n - 2^L); (hammingweight(A) + 2)*P(A, k-1)*(L - b1(n) + 1) + P(b2(A), k))
    T(n, k)=my(A=hammingweight(n)); if(k<=(A + 2), P(n, A - k + 3))

Formula

T(n, k) = P(n, wt(n) - k + 3) for n >= 0, 0 < k <= wt(n) + 2 where wt(n) = A000120(n).
P(n, 1) = 1 for n > 0 with P(0, 1) = P(0, 2) = 1.
P(n, k) = (A000120(q(n)) + 2)*P(q(n), k-1)*(A290255(n) + 1) + P(s(q(n)), k) for n > 0, k > 1 where q(n) = A053645(n) and where s(n) = n + [A063250(n) > 0]*2^(A063250(n) - 1).
T(2^n - 1, k) = abs(Stirling1(n+2, k)) for n >= 0, k > 0.
Conjectures: (Start)
T(n, 1) = (A000120(n) + 1)!*A347205(n) for n >= 0.
Sum_{k=1..A000120(n) + 2} T(n, k)*(-1)^k = 0 for n >= 0.
Sum_{k=0..2^n - 1} Sum_{j=1..A000120(k) + 2} T(k, j) = 2*A052852(n+1) for n >= 0.
Sum_{i=1..wt(k) + 2} m^(i-1)*T(k, i) = (wt(k) + 1)!*A347205(2^m*(2k+1)) for m >= 0, k >= 0 where wt(n) = A000120(n). (End)

Extensions

Offset corrected by Mikhail Kurkov, Nov 07 2024

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

A363417 a(n) = Sum_{j=0..2^n - 1} b(j) for n >= 0 where b(n) = (A023416(n) + 1)*b(A053645(n)) + [A036987(n) = 0]*b(A266341(n)) for n > 0 with b(0) = 1.

Original entry on oeis.org

1, 2, 6, 23, 106, 566, 3415, 22872, 167796, 1334596, 11414192, 104270906, 1011793389, 10379989930, 112134625986, 1271209859403, 15077083642150, 186588381229340, 2403775013224000, 32168379148440968, 446341838086450308, 6410107231501731012, 95136428354649665256
Offset: 0

Views

Author

Mikhail Kurkov, Jun 11 2023 [verification needed]

Keywords

Comments

Note that [A036987(n) = 0]*b(A266341(n)) is the same as max((1 - T(n, j))*b(A053645(n) + 2^j*(1 - T(n, j))) | 0 <= j <= A000523(n)) where T(n, k) = floor(n/2^k) mod 2.
In fact b(n) is a generalization of A347205 just as A329369 is a generalization of A341392.

Crossrefs

Similar recurrences: A284005, A329369, A341392, A347205.

Programs

  • PARI
    A063250(n)=my(L=logint(n, 2), A=0); for(i=0, L, my(B=n\2^(L-i)+1); A++; A-=logint(B, 2)==valuation(B, 2)); A
    upto(n)=my(v, v1); v=vector(2^n, i, 0); v[1]=1; v1=vector(n+1, i, 0); v1[1]=1; for(i=1, #v-1, my(L=logint(i, 2), A=i - 2^L, B=A063250(i)); v[i+1]=(L - hammingweight(i) + 2)*v[A+1] + if(B>0, v[A + 2^(B-1) + 1])); for(i=1, n, v1[i+1]=v1[i] + sum(j=2^(i-1)+1, 2^i, v[j])); v1
Previous Showing 11-13 of 13 results.