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 41-50 of 384 results. Next

A174868 Partial sums of Stern's diatomic series A002487.

Original entry on oeis.org

0, 1, 2, 4, 5, 8, 10, 13, 14, 18, 21, 26, 28, 33, 36, 40, 41, 46, 50, 57, 60, 68, 73, 80, 82, 89, 94, 102, 105, 112, 116, 121, 122, 128, 133, 142, 146, 157, 164, 174, 177, 188, 196, 209, 214, 226, 233, 242, 244, 253, 260, 272, 277, 290, 298, 309, 312, 322, 329, 340, 344, 353, 358, 364, 365, 372, 378, 389, 394, 408, 417, 430, 434, 449, 460, 478, 485, 502, 512, 525, 528, 542, 553, 572, 580, 601, 614, 632, 637, 654, 666, 685
Offset: 0

Views

Author

Jonathan Vos Post, Dec 01 2010

Keywords

Comments

After the initial 0, identical to A007729.

Examples

			a(16) = 0 + 1 + 1 + 2 + 1 + 3 + 2 + 3 + 1 + 4 + 3 + 5 + 2 + 5 + 3 + 4 + 1 = 41.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := a[n] = If[EvenQ[n], 2*a[n/2] + a[n/2 - 1], 2*a[(n - 1)/2] + a[(n + 1)/2]]; a[0] = 0; a[1] = 1; Array[a, 100, 0] (* Amiram Eldar, May 18 2023 *)
  • Python
    from itertools import accumulate, count, islice
    from functools import reduce
    def A174868_gen(): # generator of terms
        return accumulate((sum(reduce(lambda x,y:(x[0],x[0]+x[1]) if int(y) else (x[0]+x[1],x[1]),bin(n)[-1:2:-1],(1,0))) for n in count(1)),initial=0)
    A174868_list = list(islice(A174868_gen(),30)) # Chai Wah Wu, May 07 2023

Formula

a(n) = Sum_{i=0..n} A002487(i).
G.f.: (x/(1 - x))*Product_{k>=0} (1 + x^(2^k) + x^(2^(k+1))). - Ilya Gutkovskiy, Feb 27 2017
a(2k) = 2*a(k) + a(k-1); a(2k+1) = 2*a(k) + a(k+1). - Michael J. Collins, Dec 25 2018
a(n) = n^log_2(3) + Psi_D(log_2(n)) + O(n^log_2(phi)), where phi is the golden ratio (A001622) and Psi_D is a 1-periodic continuous function which is Hölder continuous with any exponent smaller than log_2(3/phi) (Heuberger et al., 2022). - Amiram Eldar, May 18 2023

A237646 G.f.: exp( Sum_{n>=1} A163659(n^3)*x^n/n ), where x*exp(Sum_{n>=1} A163659(n)*x^n/n) = S(x) is the g.f. of Stern's diatomic series (A002487).

Original entry on oeis.org

1, 1, 8, 7, 63, 56, 329, 273, 1736, 1463, 7511, 6048, 32585, 26537, 124440, 97903, 475287, 377384, 1658881, 1281497, 5783960, 4502463, 18825023, 14322560, 61171649, 46849089, 188181672, 141332583, 577889023, 436556440, 1696298665, 1259742225, 4970284200, 3710541975, 14019036535, 10308494560
Offset: 0

Views

Author

Paul D. Hanna, May 03 2014

Keywords

Comments

Compare to the g.f. of A195586.

Examples

			G.f.: A(x) = 1 + x + 8*x^2 + 7*x^3 + 63*x^4 + 56*x^5 + 329*x^6 + 273*x^7 +...
where
log(A(x)) = x + 15*x^2/2 - 2*x^3/3 + 127*x^4/4 + x^5/5 - 30*x^6/6 + x^7/7 + 1023*x^8/8 +...+ A237649(n)*x^n/n +...
Bisections: let A(x) = B(x^2) + x*C(x^2), then:
B(x) = 1 + 8*x + 63*x^2 + 329*x^3 + 1736*x^4 + 7511*x^5 + 32585*x^6 +...
C(x) = 1 + 7*x + 56*x^2 + 273*x^3 + 1463*x^4 + 6048*x^5 + 26537*x^6 + 97903*x^7 + 377384*x^8 + 1281497*x^9 + 4502463*x^10 +...+ A237647(n)*x^n +...
Note that C(x)^(1/7) = (1+x+x^2) * C(x^2)^(4/7) is an integer series:
C(x)^(1/7) = 1 + x + 5*x^2 + 4*x^3 + 30*x^4 + 26*x^5 + 106*x^6 + 80*x^7 + 459*x^8 + 379*x^9 + 1451*x^10 + 1072*x^11 + 5210*x^12 +...+ A237648(n)*x^n +...
Also, C(x) / (1+x+x^2)^3 = A(x)^4:
A(x)^4 = 1 + 4*x + 38*x^2 + 128*x^3 + 817*x^4 + 2536*x^5 + 12890*x^6 +...
Further, C(x)*C(x^2)^3 = A(x)^7:
A(x)^7 = 1 + 7*x + 77*x^2 + 420*x^3 + 2954*x^4 + 13986*x^5 + 78414*x^6 +...
The g.f. may be expressed by the product:
A(x) = (1+x+x^2) * (1+x^2+x^4)^7 * (1+x^4+x^8)^28 * (1+x^8+x^16)^112 * (1+x^16+x^32)^448 *...* (1 + x^(2*2^n) + x^(4*2^n))^(7*4^n) *...
		

Crossrefs

Programs

  • PARI
    {A163659(n)=if(n<1, 0, if(n%3, 1, -2)*sigma(2^valuation(n, 2)))}
    {a(n)=polcoeff(exp(sum(k=1, n, A163659(k^3)*x^k/k)+x*O(x^n)), n)}
    for(n=0, 40, print1(a(n), ", "))

Formula

G.f.: exp( Sum_{n>=1} A237649(n)*x^n/n ), where A237649(n) = A163659(n^3).
G.f. A(x) satisfies:
(1) A(x) = (1+x+x^2) * (1+x^2+x^4)^3 * A(x^2)^4.
(2) A(x) = (1+x+x^2) * Product_{n>=0} ( 1 + x^(2*2^n) + x^(4*2^n) )^(7*4^n).
(3) A(x) / A(-x) = (1+x+x^2) / (1-x+x^2).
Bisections: let A(x) = B(x^2) + x*C(x^2), then
(4) B(x) = (1+x) * C(x).
(5) C(x) = (1+x+x^2)^7 * C(x^2)^4.
(6) A(x) = (1+x+x^2) * C(x^2).
(7) A(x)^7 = C(x) * C(x^2)^3.
(8) A(x)^4 = C(x) / (1+x+x^2)^3.
(9) A(x)^3 = ( C(x)/A(x) - C(x^2)^4/A(x^2)^4 ) / (6*x + 14*x^3 + 6*x^5).

A237649 a(n) = A163659(n^3), where A163659 is the logarithmic derivative of Stern's diatomic series (A002487).

Original entry on oeis.org

1, 15, -2, 127, 1, -30, 1, 1023, -2, 15, 1, -254, 1, 15, -2, 8191, 1, -30, 1, 127, -2, 15, 1, -2046, 1, 15, -2, 127, 1, -30, 1, 65535, -2, 15, 1, -254, 1, 15, -2, 1023, 1, -30, 1, 127, -2, 15, 1, -16382, 1, 15, -2, 127, 1, -30, 1, 1023, -2, 15, 1, -254, 1, 15, -2, 524287, 1, -30, 1, 127
Offset: 1

Views

Author

Paul D. Hanna, May 03 2014

Keywords

Comments

Multiplicative because A163659 is. - Andrew Howroyd, Jul 27 2018

Examples

			L.g.f.: L(x) = x + 15*x^2/2 - 2*x^3/3 + 127*x^4/4 + x^5/5 - 30*x^6/6 + x^7/7 + 1023*x^8/8 +...+ A163659(n^3)*x^n/n +...
where
exp(L(x)) = 1 + x + 8*x^2 + 7*x^3 + 63*x^4 + 56*x^5 + 329*x^6 + 273*x^7 + 1736*x^8 +...+ A237646(n)*x^n +...
		

Crossrefs

Programs

  • PARI
    {A163659(n)=if(n<1, 0, if(n%3, 1, -2)*sigma(2^valuation(n, 2)))}
    {a(n)=A163659(n^3)}
    for(n=1,64,print1(a(n),", "))
    
  • PARI
    {a(n)=local(X=x+x*O(x^n),A);A=log(1+X+X^2) + sum(k=0,#binary(n),7*4^k*log(1 + X^(2*2^k) + X^(4*2^k)));n*polcoeff(A,n)}
    for(n=1,64,print1(a(n),", "))

Formula

L.g.f.: log(1+x+x^2) + Sum_{n>=0} 7*4^n * log(1 + x^(2*2^n) + x^(4*2^n)) = Sum_{n>=1} a(n)*x^n/n.
G.f.: x*(1+2*x)/(1+x+x^2) + Sum_{n>=0} 14*8^n * x^(2*2^n) * (1 + 2*x^(2*2^n)) / (1 + x^(2*2^n) + x^(4*2^n)).

A244474 4th-largest term in n-th row of Stern's diatomic triangle A002487.

Original entry on oeis.org

2, 4, 10, 17, 29, 47, 79, 128, 208, 337, 546, 883, 1429, 2312, 3741, 6053, 9794, 15847, 25641, 41488, 67129, 108617
Offset: 3

Views

Author

N. J. A. Sloane, Jul 01 2014

Keywords

Crossrefs

Programs

  • Maple
    A002487 := proc(n,k)
        option remember;
        if k =0 then
            1;
        elif k = 2^n-1 then
            n+1 ;
        elif type(k,'even') then
            procname(n-1,k/2) ;
        else
            procname(n-1,(k-1)/2)+procname(n-1,(k+1)/2) ;
        end if;
    end proc:
    A244474 := proc(n)
        {seq(A002487(n,k),k=0..2^n-1)} ;
        sort(%) ;
        op(-4,%) ;
    end proc:
    for n from 3 do
        print(A244474(n)) ;
    od: # R. J. Mathar, Oct 25 2014
  • Mathematica
    s[n_] := s[n] = Switch[n, 0, 0, 1, 1, _, If[EvenQ[n], s[n/2], s[(n - 1)/2] + s[(n - 1)/2 + 1]]];
    T = Table[s[n], {n, 0, 2^25}] // Flatten // SplitBy[#, If[# == 1, 1, 0]&]& // DeleteCases[#, {1}]&;
    Union[#][[-4]]& /@ T[[5 ;;]] (* Jean-François Alcover, Mar 12 2023 *)
  • Python
    from itertools import product
    from functools import reduce
    def A244474(n): return sorted(set(sum(reduce(lambda x,y:(x[0],x[0]+x[1]) if y else (x[0]+x[1],x[1]),k,(1,0))) for k in product((False,True),repeat=n)),reverse=True)[3] # Chai Wah Wu, Jun 20 2022

Formula

G.f.: (-2-2*x-4*x^2-3*x^3-2*x^4-x^5-3*x^6-2*x^7-x^8-x^9-x^10)/(-1+x+x^2) (conjectured) - Jean-François Alcover, Mar 12 2023

Extensions

a(24) from Jean-François Alcover, Mar 12 2023

A244475 5th-largest term in the n-th row of Stern's diatomic triangle A002487.

Original entry on oeis.org

1, 3, 9, 16, 27, 46, 76, 123, 207, 335, 545, 882, 1428, 2311, 3740, 6051, 9791, 15842, 25633, 41475, 67108, 108583, 175691, 284274, 459965, 744239, 1204204, 1948443, 3152647, 5101090, 8253737
Offset: 3

Views

Author

N. J. A. Sloane, Jul 01 2014

Keywords

Crossrefs

Programs

  • Maple
    A002487 := proc(n,k)
        option remember;
        if k =0 then
            1;
        elif k = 2^n-1 then
            n+1 ;
        elif type(k,'even') then
            procname(n-1,k/2) ;
        else
            procname(n-1,(k-1)/2)+procname(n-1,(k+1)/2) ;
        end if;
    end proc:
    A244475 := proc(n)
        {seq(A002487(n,k),k=0..2^n-1)} ;
        sort(%) ;
        op(-5,%) ;
    end proc:
    for n from 3 do
        print(A244475(n)) ;
    od: # R. J. Mathar, Oct 25 2014
  • Mathematica
    s[n_, k_] := s[n, k] = Which[k == 0, 1, k == 2^n-1, n+1, EvenQ[k], s[n-1, k/2], True, s[n-1, (k-1)/2] + s[n-1, (k+1)/2]];
    row[n_] := Table[s[n, k], {k, 0, 2^n-1}];
    a[n_] := If[n == 3, 1, Union[row[n]][[-5]]];
    Table[Print[n, " ", a[n]]; a[n], {n, 3, 23}] (* Jean-François Alcover, Mar 13 2023, after R. J. Mathar *)
  • Python
    from itertools import product
    from functools import reduce
    def A244475(n): return sorted(set(sum(reduce(lambda x,y:(x[0],x[0]+x[1]) if y else (x[0]+x[1],x[1]),k,(1,0))) for k in product((False,True),repeat=n)),reverse=True)[4] # Chai Wah Wu, Jun 19 2022

Formula

Conjectured g.f.: -x^3*(x^14+ x^13+ x^12+ 2*x^11 +3*x^10 +5*x^9 +8*x^8 +x^7 +3*x^6 +3*x^5 +2*x^4 +4*x^3 +5*x^2 +2*x +1) / (x^2+x-1). - Alois P. Heinz, Jun 20 2022

Extensions

a(24)-a(25) from Alois P. Heinz, Jun 19 2022
a(26)-a(33) from Chai Wah Wu, Jun 20 2022

A283474 a(0) = 0, a(1) = 1, for n > 1, a(n) = a(n-1) + a(n-A002487(n)).

Original entry on oeis.org

0, 1, 2, 3, 6, 8, 14, 20, 40, 48, 68, 82, 150, 190, 272, 354, 708, 858, 1130, 1280, 2138, 2328, 3186, 3894, 7080, 8210, 10538, 11818, 20028, 23214, 33752, 44290, 88580, 100398, 123612, 134150, 222730, 233268, 277558, 300772, 534040, 567792, 691404, 725156, 1025928, 1126326, 1427098, 1704656, 3131754, 3665794
Offset: 0

Views

Author

Antti Karttunen, Mar 23 2017

Keywords

Crossrefs

Cf. A283479 (first differences).

Formula

a(0) = 0, a(1) = 1, for n > 1, a(n) = a(n-1) + a(A284013(n)).

A283976 a(2n) = A002487(n), a(2n+1) = A002487(n) OR A002487(n+1), where OR is bitwise-or (A003986).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Mar 21 2017

Keywords

Crossrefs

Programs

  • Mathematica
    a[0] = 0; a[1] = 1; a[n_] := If[EvenQ@ n, a[n/2], a[(n - 1)/2] + a[(n + 1)/2]]; Table[If[EvenQ@ n, a[n/2], BitOr[a[#], a[# + 1]] &[(n - 1)/2]], {n, 0, 108}] (* Michael De Vlieger, Mar 22 2017 *)
  • PARI
    A(n) = if(n<2, n, if(n%2, A(n\2) + A((n + 1)/2), A(n/2)));
    a(n) = if(n<2, n, if(n%2, bitor(A(n\2), A((n + 1)/2)), A(n\2)));
    for(n=0, 101, print1(a(n),", ")) \\ Indranil Ghosh, Mar 23 2017
  • Scheme
    (define (A283976 n) (if (even? n) (A002487 n) (A003986bi (A002487 (/ (- n 1) 2)) (A002487 (/ (+ n 1) 2))))) ;; Where A003986bi implements bitwise-OR (A003986).
    

Formula

a(2n) = A002487(2n) = A002487(n), a(2n+1) = A002487(n) OR A002487(n+1), where OR is bitwise-or (A003986).
a(n) = A283977(n) + A283978(n).
a(n) = A002487(n) - A283978(n).

A283977 a(2n) = A002487(n), a(2n+1) = A002487(n) XOR A002487(n+1), where XOR is bitwise-xor (A003987).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Mar 21 2017

Keywords

Crossrefs

Bisections: A002487, A283987.

Programs

  • Mathematica
    a[0] = 0; a[1] = 1; a[n_] := If[EvenQ@ n, a[n/2], a[(n - 1)/2] + a[(n + 1)/2]]; Table[If[EvenQ@ n, a[n/2], BitXor[a[#], a[# + 1]] &[(n - 1)/2]], {n, 0, 112}] (* Michael De Vlieger, Mar 22 2017 *)
  • PARI
    A(n) = if(n<2, n, if(n%2, A(n\2) + A((n + 1)/2), A(n/2)));
    a(n) = if(n<2, n, if(n%2, bitxor(A(n\2), A((n + 1)/2)), A(n\2)));
    for(n=0, 120, print1(a(n), ", ")) \\ Indranil Ghosh, Mar 23 2017
  • Scheme
    (define (A283977 n) (if (even? n) (A002487 n) (A003987bi (A002487 (/ (- n 1) 2)) (A002487 (/ (+ n 1) 2))))) ;; Where A003987bi implements bitwise-XOR (A003987).
    

Formula

a(2n) = A002487(2n) = A002487(n), a(2n+1) = A002487(n) XOR A002487(n+1), where XOR is bitwise-xor (A003987).
a(n) = A283976(n) - A283978(n).
a(n) = A002487(n) - 2*A283978(n).

A283978 a(2n) = 0, a(2n+1) = A002487(n) AND A002487(n+1), where AND is bitwise-and (A004198).

Original entry on oeis.org

0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 2, 0, 2, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 4, 0, 4, 0, 3, 0, 0, 0, 0, 0, 5, 0, 2, 0, 2, 0, 5, 0, 0, 0, 0, 0, 3, 0, 4, 0, 4, 0, 1, 0, 0, 0, 4, 0, 1, 0, 0, 0, 0, 0, 3, 0, 2, 0, 2, 0, 3, 0, 8, 0, 8, 0, 5, 0, 4, 0, 4, 0, 1, 0, 0, 0, 0, 0, 1, 0, 4, 0, 4, 0, 5, 0, 8, 0, 8, 0, 3, 0, 2, 0, 2, 0, 3, 0, 0, 0
Offset: 0

Views

Author

Antti Karttunen, Mar 21 2017

Keywords

Crossrefs

Programs

  • Mathematica
    a[0] = 0; a[1] = 1; a[n_] := If[EvenQ@ n, a[n/2], a[(n - 1)/2] + a[(n + 1)/2]]; Table[If[EvenQ@ n, 0, BitAnd[a[#], a[# + 1]] &[(n - 1)/2]], {n, 0, 120}] (* Michael De Vlieger, Mar 22 2017 *)
  • PARI
    A(n) = if(n<2, n, if(n%2, A(n\2) + A((n + 1)/2), A(n/2)));
    a(n) = if(n<2, 0, if(n%2, bitand(A(n\2), A((n + 1)/2)), 0));
    for(n=0, 120, print1(a(n), ", ")) \\ Indranil Ghosh, Mar 23 2017
  • Scheme
    (define (A283978 n) (if (even? n) 0 (A004198bi (A002487 (/ (- n 1) 2)) (A002487 (/ (+ n 1) 2))))) ;; Where A004198bi implements bitwise-AND (A004198).
    

Formula

a(2n) = 0, a(2n+1) = A002487(n) AND A002487(n+1), where AND is bitwise-and (A004198).
a(n) = A283976(n) - A283977(n).
a(n) = A002487(n) - A283976(n) = (A002487(n) - A283977(n))/2.

A284460 Permutation of the positive integers: this permutation transforms the enumeration system of positive irreducible fractions A245327/A245328 into the enumeration system A002487/A002487' (Calkin-Wilf), and A020651/A020650 (Yu-Ting inverted) into A162911/A162912(Drib).

Original entry on oeis.org

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

Views

Author

Yosu Yurramendi, Mar 28 2017

Keywords

Comments

The inverse permutation is A284459.

Crossrefs

Programs

  • R
    maxrow <- 4 # by choice
    a <- 1
    b01 <- 1
    for(m in 0:maxrow){
      b01 <- c(b01,rep(1,2^(m+1))); b01[(2^(m+1)+2^m-2^(m-1)):(2^(m+1)+2^m+2^(m-1)-1)] <- 0
      for(k in 0:(2^m-1)){
        a[2^(m+1) +       k] <- a[2^m + k] + 2^(m + b01[2^(m+1) +       k])
        a[2^(m+1) + 2^m + k] <- a[2^m + k] + 2^(m + b01[2^(m+1) + 2^m + k])
    }}
    a
    # Yosu Yurramendi, Mar 28 2017

Formula

a(n) = A231550(A258996(n)) = A092569(A231550(n)), n > 0 . - Yosu Yurramendi, Apr 10 2017
Previous Showing 41-50 of 384 results. Next