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-10 of 91 results. Next

A096111 If n = 2^k - 1, then a(n) = k+1, otherwise a(n) = (A000523(n)+1)*a(A053645(n)).

Original entry on oeis.org

1, 2, 2, 3, 3, 6, 6, 4, 4, 8, 8, 12, 12, 24, 24, 5, 5, 10, 10, 15, 15, 30, 30, 20, 20, 40, 40, 60, 60, 120, 120, 6, 6, 12, 12, 18, 18, 36, 36, 24, 24, 48, 48, 72, 72, 144, 144, 30, 30, 60, 60, 90, 90, 180, 180, 120, 120, 240, 240, 360, 360, 720, 720, 7, 7, 14, 14, 21, 21
Offset: 0

Views

Author

Amarnath Murthy, Jun 29 2004

Keywords

Comments

Each n > 1 occurs 2*A045778(n) times in the sequence.
f(n+2^k) = (k+1)*f(n) if 2^k > n+1. - Robert Israel, Apr 25 2016
If the binary indices of n (row n of A048793) are the positions 1's in its reversed binary expansion, then a(n) is the product of all binary indices of n + 1. The number of binary indices of n is A000120(n), their sum is A029931(n), and their average is A326699(n)/A326700(n). - Gus Wiseman, Jul 27 2019

Crossrefs

Permutation of A096115, i.e. a(n) = A096115(A122198(n+1)) [Note the different starting offsets]. Bisection: A121663. Cf. A096113, A052330.
Cf. A029931.

Programs

  • Maple
    f:= proc(n) local L;
        L:= convert(2*n+2,base,2);
        convert(subs(0=NULL,zip(`*`,L, [$0..nops(L)-1])),`*`);
    end proc:
    map(f, [$0..100]); # Robert Israel, Apr 25 2016
  • Mathematica
    CoefficientList[(Product[1 + k x^(2^(k - 1)), {k, 7}] - 1)/x, x] (* Michael De Vlieger, Apr 08 2016 *)
    bpe[n_]:=Join@@Position[Reverse[IntegerDigits[n,2]],1];Table[Times@@bpe[n+1],{n,0,100}] (* Gus Wiseman, Jul 26 2019 *)
  • PARI
    N=166; q='q+O('q^N);
    gf= (prod(n=1,1+ceil(log(N)/log(2)), 1+n*q^(2^(n-1)) ) - 1) / q;
    Vec(gf)
    /* Joerg Arndt, Oct 06 2012 */
  • Scheme
    (define (A096111 n) (cond ((pow2? (+ n 1)) (+ 2 (A000523 n))) (else (* (+ 1 (A000523 n)) (A096111 (A053645 n))))))
    (define (pow2? n) (and (> n 0) (zero? (A004198bi n (- n 1)))))
    

Formula

G.f.: ( prod(k>=1, 1+k*x^(2^(k-1)) )- 1 ) / x. - Vladeta Jovovic, Nov 08 2005
a(n) is the product of the exponents in the binary expansion of 2*n + 2. - Peter Kagey, Apr 24 2016

Extensions

Edited, extended and Scheme code added by Antti Karttunen, Aug 25 2006

A126441 Tabular arrangement of the natural numbers: the row on which any nonzero term a(n) appears in is A053645(a(n))=A053645(n+1), and the column is A161511(a(n)). Table is presented by columns with 2^{k-1} items in column k, unused positions are filled with 0's.

Original entry on oeis.org

1, 2, 3, 4, 5, 0, 7, 8, 9, 6, 11, 0, 0, 0, 15, 16, 17, 10, 19, 0, 13, 0, 23, 0, 0, 0, 0, 0, 0, 0, 31, 32, 33, 18, 35, 12, 21, 14, 39, 0, 0, 0, 27, 0, 0, 0, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 64, 65, 34, 67, 20, 37, 22, 71, 0, 25, 0, 43, 0, 29, 0, 79, 0, 0, 0, 0, 0, 0, 0, 55, 0, 0
Offset: 0

Views

Author

Alford Arnold, Jan 19 2007

Keywords

Comments

Note: 1 might be a more natural starting offset for this sequence, although the identities concerning A053645 and A161511 would have to be changed. - Antti Karttunen, Oct 12 2009.
This can be regarded as an arrangement of the partitions, indexed by position in A125106. The partitions in a given row all have the same remaining partition when the largest part is removed; specifically, the partition indexed by the row number in A125106 (with row 0 having the empty partition remaining).
The first value on row n is A004760(n+1). The second value on each row is A004760(n+1) plus A062383(n); subsequent values increase by ever enlarging powers of two. Or equivalently, each subsequent value on the row after the first nonzero value is given by A004754(previous value on the same row).
A055941(r) tells how many terms the row r (>= 0) has been shifted rightward from its "natural position", i.e. with how many zeros that row has been prepended.
The number of (nonzero) entries in column k is A000041(k).

Examples

			The largest power of 2 <= 6 is 4, 6 - 4 = 2, so 6 is in row 2. By A125106, 6 corresponds to the partition [2^2], total 4, so 6 goes in column 4. Thus T(2,4) = 6.
The table begins:
1.2.4..8.16.32.64.128.256.512.1024
..3.5..9.17.33.65.129.257.513.1025
.......6.10.18.34..66.130.258..514
....7.11.19.35.67.131.259.515.1027
............12.20..36..68.132..260
.........13.21.37..69.133.261..517
............14.22..38..70.134..262
......15.23.39.71.135.263.519.1031
...................24..40..72..136
...............25..41..73.137..265
...................26..42..74..138
............27.43..75.139.267..523
.......................28..44...76
...............29..45..77.141..269
...................30..46..78..142
.........31.47.79.143.271.527.1039
...........................48...80
.......................49..81..145
...........................50...82
...................51..83.147..275
		

Crossrefs

Cf. A125106, A053645, A000041, A004760, A062383, A000079 (column lengths).
A053645(a(A166274(n))) = A053645(1+A166274(n)) for all n>=1.
Positions of zeros: A166275, this sequence without zeros: A161924. A161920(n) gives the position of the first nonzero term on the row n-1.

Programs

  • Mathematica
    columns = 7; row[n_] := n-2^Floor[Log2[n]]; col[0] = 0; col[n_] := If[EvenQ[n], col[n/2] + DigitCount[n/2, 2, 1], col[(n-1)/2]+1]; Clear[T]; T[, ] = 0; Do[T[row[k], col[k]] = k, {k, 1, 2^columns}]; Table[T[n-1, k], {k, 1, columns}, {n, 1, 2^(k-1)}] // Flatten (* Jean-François Alcover, Sep 09 2017 *)

Extensions

Edited by Franklin T. Adams-Watters, Jan 23 2007
Further edited and Scheme-code added by Antti Karttunen, Oct 12 2009

A121663 a(0) = 1; if n = 2^k, a(n) = k+2, otherwise a(n)=(A000523(n)+2)*a(A053645(n)).

Original entry on oeis.org

1, 2, 3, 6, 4, 8, 12, 24, 5, 10, 15, 30, 20, 40, 60, 120, 6, 12, 18, 36, 24, 48, 72, 144, 30, 60, 90, 180, 120, 240, 360, 720, 7, 14, 21, 42, 28, 56, 84, 168, 35, 70, 105, 210, 140, 280, 420, 840, 42, 84, 126, 252, 168, 336, 504, 1008, 210, 420, 630, 1260, 840, 1680
Offset: 0

Views

Author

Antti Karttunen, Aug 25 2006

Keywords

Comments

Each n occurs A045778(n) times in the sequence.

Crossrefs

Bisection of A096111.

Programs

  • Mathematica
    f[0] := 1; f[n_] := If[(b = n - 2^(k = Floor[Log2[n]])) == 0, k + 2, (k + 2)*f[b]]; Table[f[n], {n, 0, 61}] (* Ivan Neretin, May 09 2015 *)
  • Scheme
    (define (A121663 n) (cond ((zero? n) 1) ((pow2? n) (+ 2 (A000523 n))) (else (* (+ 2 (A000523 n)) (A121663 (A053645 n))))))
    (define (pow2? n) (and (> n 0) (zero? (A004198bi n (- n 1)))))

Formula

G.f.: Product_{k>=0} (1 + (k + 2) * x^(2^k)). - Ilya Gutkovskiy, Aug 19 2019

A300725 Möbius transform of A053645(n), distance to the largest power of 2 less than or equal to n.

Original entry on oeis.org

0, 0, 1, 0, 1, 1, 3, 0, 0, 1, 3, 2, 5, 3, 5, 0, 1, 0, 3, 2, 1, 3, 7, 4, 8, 5, 10, 6, 13, 5, 15, 0, -3, 1, -1, 0, 5, 3, 1, 4, 9, 1, 11, 6, 6, 7, 15, 8, 14, 8, 17, 10, 21, 10, 19, 12, 21, 13, 27, 10, 29, 15, 26, 0, -5, -3, 3, 2, -3, -1, 7, 0, 9, 5, -4, 6, 7, 1, 15, 8, 6, 9, 19, 2, 19, 11, 9, 12, 25, 6, 19, 14, 13, 15, 27
Offset: 1

Views

Author

Antti Karttunen, Mar 11 2018

Keywords

Crossrefs

Programs

  • Mathematica
    With[{s = Array[# - 2^Floor@ Log2@ # &, 95]}, Table[DivisorSum[n, MoebiusMu[n/#] s[[#]] &], {n, Length@ s}]] (* Michael De Vlieger, Mar 13 2018 *)
  • PARI
    A053644(n) = { my(k=1); while(k<=n, k<<=1); (k>>1); }; \\ From A053644
    A053645(n) = (n-A053644(n));
    A300725(n) = sumdiv(n,d,moebius(n/d)*A053645(d));

Formula

a(n) = Sum_{d|n} A008683(n/d)*A053645(d).
a(n) + A300724(n) = A000010(n).

A300723 Möbius-transform of A005187(A053645(n)).

Original entry on oeis.org

0, 0, 1, 0, 1, 2, 4, 0, 0, 2, 4, 4, 8, 6, 9, 0, 1, 0, 4, 4, 3, 6, 11, 8, 15, 10, 18, 12, 23, 10, 26, 0, -4, 2, -1, 0, 8, 6, 2, 8, 16, 2, 19, 12, 12, 14, 26, 16, 28, 16, 33, 20, 39, 20, 37, 24, 42, 26, 50, 20, 54, 30, 49, 0, -8, -6, 4, 4, -4, -2, 11, 0, 16, 10, -7, 12, 15, 2, 26, 16, 13, 18, 35, 4, 37, 22, 18, 24, 47, 12
Offset: 1

Views

Author

Antti Karttunen, Mar 12 2018

Keywords

Crossrefs

Programs

  • Mathematica
    With[{s = Array[2 # - DigitCount[2 #, 2, 1] &[# - 2^Floor@ Log2@ #] &, 90]}, Table[DivisorSum[n, MoebiusMu[n/#] s[[#]] &], {n, Length@ s}]] (* Michael De Vlieger, Mar 13 2018 *)
  • PARI
    A005187(n) = { my(s=n); while(n>>=1, s+=n); s; };
    A053644(n) = { my(k=1); while(k<=n, k<<=1); (k>>1); }; \\ From A053644
    A053645(n) = (n-A053644(n));
    A300723(n) = sumdiv(n,d,moebius(n/d)*A005187(A053645(d)));

Formula

a(n) = Sum_{d|n} A008683(n/d)*A005187(A053645(d)).
a(1) = 0; for n > 1, a(n) = A297111(n) - 2*A300724(n).

A323234 Lexicographically earliest sequence such that a(i) = a(j) => f(i) = f(j), where f(1) = 0, and for n > 1, f(n) = ordered pair [A053645(n), A079944(n-2)], where A053645(n) gives n without its most significant bit, while A079944(n-2) gives the second most significant bit of n.

Original entry on oeis.org

1, 2, 3, 2, 4, 5, 6, 2, 4, 7, 8, 9, 10, 11, 12, 2, 4, 7, 8, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 2, 4, 7, 8, 13, 14, 15, 16, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 2, 4, 7, 8, 13, 14, 15, 16, 25, 26, 27, 28, 29, 30, 31, 32, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61
Offset: 1

Views

Author

Antti Karttunen, Jan 08 2019

Keywords

Comments

Also the restricted growth sequence transform of function f(1) = 0, f(n) = [A053645(n), A278222(n)] for n > 1.
For all i, j:
a(i) = a(j) => A286622(i) = A286622(j),
a(i) = a(j) => A323235(i) = A323235(j),
a(i) = a(j) => A323236(i) = A323236(j).

Crossrefs

Cf. also A300226 (an analogous filter sequence for prime factorization).

Programs

  • PARI
    up_to = 65537;
    rgs_transform(invec) = { my(om = Map(), outvec = vector(length(invec)), u=1); for(i=1, length(invec), if(mapisdefined(om,invec[i]), my(pp = mapget(om, invec[i])); outvec[i] = outvec[pp] , mapput(om,invec[i],i); outvec[i] = u; u++ )); outvec; };
    A053644(n) = { my(k=1); while(k<=n, k<<=1); (k>>1); }; \\ From A053644
    A053645(n) = (n-A053644(n));
    A079944off0(n) = (1==binary(2+n)[2]);
    A323234aux(n) = if(1==n,0,[A053645(n), A079944off0(n-2)]);
    v323234 = rgs_transform(vector(up_to,n,A323234aux(n)));
    A323234(n) = v323234[n];

A083741 a(n) = L(n) + a(L(n)), where L(n) = n - 2^floor(log_2(n)) (A053645).

Original entry on oeis.org

0, 0, 0, 1, 0, 1, 2, 4, 0, 1, 2, 4, 4, 6, 8, 11, 0, 1, 2, 4, 4, 6, 8, 11, 8, 10, 12, 15, 16, 19, 22, 26, 0, 1, 2, 4, 4, 6, 8, 11, 8, 10, 12, 15, 16, 19, 22, 26, 16, 18, 20, 23, 24, 27, 30, 34, 32, 35, 38, 42, 44, 48, 52, 57, 0, 1, 2, 4, 4, 6, 8, 11, 8, 10, 12, 15, 16, 19, 22, 26, 16, 18, 20
Offset: 0

Views

Author

Ralf Stephan, May 05 2003

Keywords

Comments

a(2^j)=0. Local extrema are a(2^j-1) = 2^j-j-1 (A000295).

Crossrefs

Programs

  • Mathematica
    f[l_]:=Join[l,l-1+Range[Length[l]]]; Nest[f,{0},7] (* Ray Chandler, Jun 01 2010 *)
  • PARI
    a(n)=if(n<2,0,if(n%2==0,2*a(n/2),if(n%4==1,2*a((n-1)/4)+a((n+1)/ 2),-2*a((n-3)/4)+3*a((n-3)/2+1)+1)))
    
  • PARI
    a(n) = my(v=binary(n),c=-1); for(i=1,#v, if(v[i],v[i]=c++)); fromdigits(v,2); \\ Kevin Ryde, Apr 16 2024

Formula

a(0)=0, a(1)=0, a(2n)=2a(n), a(4n+1)=2a(n)+a(2n+1), a(4n+3)=-2a(n)+3a(2n+1)+1.
a(n) = Sum_{i=0..k} i*2^e[i] where the binary expansion of n is n = Sum_{i=0..k} 2^e[i] with decreasing exponents e[0] > ... > e[k] (A272011). - Kevin Ryde, Apr 16 2024

Extensions

Extended by Ray Chandler, Mar 04 2010

A346422 a(n) = (1 + A014081(n))*a(A053645(n)) for n > 0 with a(0) = 1.

Original entry on oeis.org

1, 1, 1, 2, 1, 1, 2, 6, 1, 1, 1, 4, 2, 2, 6, 24, 1, 1, 1, 4, 1, 1, 4, 18, 2, 2, 2, 12, 6, 6, 24, 120, 1, 1, 1, 4, 1, 1, 4, 18, 1, 1, 1, 8, 4, 4, 18, 96, 2, 2, 2, 12, 2, 2, 12, 72, 6, 6, 6, 48, 24, 24, 120, 720, 1, 1, 1, 4, 1, 1, 4, 18, 1, 1, 1, 8, 4, 4, 18, 96
Offset: 0

Views

Author

Mikhail Kurkov, Aug 08 2021 [verification needed]

Keywords

Crossrefs

Cf. A003714 (positions of 1's), A014081, A036987, A053645.

Programs

  • Mathematica
    Nest[Append[#1, (1 + Count[Partition[IntegerDigits[#2, 2], 2, 1], {1, 1}]) #1[[#2 - 2^Floor@ Log2[#2] + 1]]] & @@ {#, Length[#]} &, {1}, 79] (* Michael De Vlieger, Feb 04 2022 *)
  • PARI
    a(n)=if(n==0, 1, (1+b(n))*a(c(n)))
    b(n)=if(n==1, 0, if(n%4<2, b(n\4), b(n\2) + n%2)) \\ A014081
    c(n)=if(n==1, 0, 2*c(n\2) + n%2) \\ A053645
    
  • PARI
    a(n) = my(f=1,ret=1); if(n, for(i=0,logint(n,2), if(bittest(n,i), ret*=(f+=bittest(n,i-1))))); ret; \\ Kevin Ryde, Aug 25 2021
    
  • Python
    from functools import lru_cache
    from re import split
    @lru_cache(maxsize=None)
    def A346422(n): return 1 if n <= 1 else A346422(int((s:= bin(n)[2:])[1:],2))*(1+sum(len(d)-1 for d in split('0+', s) if d != '')) # Chai Wah Wu, Feb 04 2022

Formula

a(n) = (1 + A014081(n))*a(A053645(n)) for n > 0 with a(0) = 1.
a(4n+1) = a(2n) = a(n) for n > 0 with a(0) = a(1) = 1.
a(4n+3) = 2!*b(n), a(8n+11) = 2*2!*b'(n), b'(2n) = b(n), b'(2n+1) = b'(n),
a(8n+7) = 3!*c(n), a(16n+23) = 3*3!*c'(n), c'(2n) = c(n), c'(2n+1) = c'(n),
a(16n+15) = 4!*d(n), a(32n+47) = 4*4!*d'(n), d'(2n) = d(n), d'(2n+1) = d'(n),
a(32n+31) = 5!*e(n), a(64n+95) = 5*5!*e'(n), e'(2n) = e(n), e'(2n+1) = e'(n),
and so on, i.e.,
a(2^m*(n+1) - 1) = m!*z(n), a(2^m*(2n+3) - 1) = m*m!*z'(n), z'(2n) = z(n), z'(2n+1) = z'(n).
From that, we get:
a(2^3*(2n+1) + 3) = 2*a(4n+3), a(2^3*(2n+1) + 11) = a(8n+11),
a(2^4*(2n+1) + 7) = 3*a(8n+7), a(2^4*(2n+1) + 23) = a(16n+23),
a(2^5*(2n+1) + 15) = 4*a(16n+15), a(2^5*(2n+1) + 47) = a(32n+47),
a(2^6*(2n+1) + 31) = 5*a(32n+31), a(2^6*(2n+1) + 95) = a(64n+95),
and so on, i.e.,
a(2^m*(4n+3) - 1) = m*a(2^m*(n+1) - 1), a(2^m*(4n+5) - 1) = a(2^m*(2n+3) - 1).
Let
p(n) = 0 if A036987(n) = 1 otherwise p(2n+1) = 2 + p(n), p(2n) = 2 - (n mod 2) for n > 0 with p(0) = p(1) = 0,
q(2n+1) = 2^(n+2) - 1, q(2n) = 2^(n+2) + q(2n-1) for n > 0 with q(1) = 3,
p_1(n) = 0 if A036987(n) = 1 otherwise q(p(n)) for n > 0 with p_1(0) = 0,
p_2(n) = 0 if A036987(n) = 1 otherwise p_2(2n+1) = p_2(n), p_2(2n) = floor((n - 1)/2) for n > 0 with p_2(0) = p_2(1) = 0,
so
a(4n+3) = (log_2(4n+4))! if A036987(4n+3) = 1 otherwise (1 + (p(n) mod 2)*(p(n) + 1)/2)*a(p_2(n)*2^(floor(p(n)/2) + 2) + p_1(n)) for n >= 0.
a((4^n - 1)/3) = 1 for n >= 0.
a(2^m*(2^n - 1)) = n! for n > 0, m >= 0.

A357990 Square array T(n, k), n >= 0, k > 0, read by antidiagonals, where T(0, k) = 1 for k > 0 and where T(n, k) = R(n, k+1) - R(n, k) for n > 0, k > 0. Here R(n, k) = T(A053645(n), k)*k^(A290255(n) + 1).

Original entry on oeis.org

1, 1, 1, 3, 1, 1, 1, 5, 1, 1, 7, 1, 7, 1, 1, 3, 19, 1, 9, 1, 1, 7, 5, 37, 1, 11, 1, 1, 1, 11, 7, 61, 1, 13, 1, 1, 15, 1, 15, 9, 91, 1, 15, 1, 1, 7, 65, 1, 19, 11, 127, 1, 17, 1, 1, 17, 19, 175, 1, 23, 13, 169, 1, 19, 1, 1, 3, 43, 37, 369, 1, 27, 15, 217, 1, 21
Offset: 0

Views

Author

Mikhail Kurkov, Nov 20 2022

Keywords

Examples

			Square array begins:
   1,  1,   1,   1,   1,    1,    1,    1, ...
   1,  1,   1,   1,   1,    1,    1,    1, ...
   3,  5,   7,   9,  11,   13,   15,   17, ...
   1,  1,   1,   1,   1,    1,    1,    1, ...
   7, 19,  37,  61,  91,  127,  169,  217, ...
   3,  5,   7,   9,  11,   13,   15,   17, ...
   7, 11,  15,  19,  23,   27,   31,   35, ...
   1,  1,   1,   1,   1,    1,    1,    1, ...
  15, 65, 175, 369, 671, 1105, 1695, 2465, ...
		

Crossrefs

Programs

  • PARI
    R(n,k)=my(L=logint(n, 2), A=n - 2^L); T(A, k)*k^(L - if(A>0, logint(A, 2) + 1) + 1)
    T(n,k)=if(n==0, 1, R(n, k+1) - R(n, k))
    
  • PARI
    T(n, k) = my(A = 2*n+1, B, C, v1, v2); v1 = []; while(A > 0, B=valuation(A, 2); v1=concat(v1, B+1); A \= 2^(B+1)); v1 = Vecrev(v1); A = #v1; v2 = vector(A, i, 1); for(i=1, A-1, B = A-i; for(j=1, B, C = B-j+k+1; v2[j] = v2[j]*C^v1[B] - v2[j+1]*(C-1)^v1[B])); v2[1] \\ Mikhail Kurkov, Apr 30 2024

Formula

Conjecture: T(n, 1) = A329369(n).

A075149 Sum_{i=0..2*A053645(n)} (C(2*A053645(n),i) mod 2)*A000045(n-i) [where C(r,c) is the binomial coefficient (A007318) and A000045(n) is the n-th Fibonacci number].

Original entry on oeis.org

0, 1, 1, 3, 3, 7, 9, 21, 21, 47, 63, 141, 147, 329, 441, 987, 987, 2207, 2961, 6621, 6909, 15449, 20727, 46347, 46389, 103729, 139167, 311187, 324723, 726103, 974169, 2178309, 2178309, 4870847, 6534927, 14612541, 15248163, 34095929, 45744489
Offset: 0

Views

Author

Antti Karttunen, Sep 05 2002

Keywords

Crossrefs

Bisection gives A050614.

Programs

  • Maple
    with(combinat); [seq(A075149(n,n=0..50)]; A075149 := n -> add((binomial(2*r(n),i) mod 2)*fibonacci(n-i),i=0..2*r(n));
    r := n -> n - 2^floor_log_2(n);
    floor_log_2 := proc(n) local nn,i; nn := n; for i from -1 to n do if(0 = nn) then RETURN(i); fi; nn := floor(nn/2); od; end;
Showing 1-10 of 91 results. Next