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

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

Original entry on oeis.org

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

Views

Author

Yosu Yurramendi, Mar 27 2017

Keywords

Comments

The inverse permutation is A284460.

Crossrefs

Programs

  • R
    maxrow <- 12 # by choice
    a <- 1
    b01 <- 1
    for(m in 0:maxrow){
      b01 <- c(b01, c(1-b01[2^m:(2^(m+1)-1)], b01[2^m:(2^(m+1)-1)]) )
      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 27 2017
    
  • R
    maxblock <- 7 # by choice
    a <- 1:3
    for(n in 4:2^maxblock){
    ones <- which(as.integer(intToBits(n)) == 1)
    nbit <- as.integer(intToBits(n))[1:tail(ones, n = 1)]
    anbit <- nbit
    for(i in 2:(length(anbit) - 1))
       anbit[i] <- 1 - bitwXor(anbit[i], anbit[i-1])
    a <- c(a, sum(anbit*2^(0:(length(anbit) - 1))))
    }
    a
    # Yosu Yurramendi, Apr 25 2021

Formula

a(n) = A258996(A231551(n)) = A231551(A092569(n)), n > 0 . - Yosu Yurramendi, Apr 10 2017

A317839 Möbius transform of A002487, Stern's Diatomic sequence.

Original entry on oeis.org

1, 0, 1, 0, 2, 0, 2, 0, 2, 0, 4, 0, 4, 0, 0, 0, 4, 0, 6, 0, 4, 0, 6, 0, 4, 0, 4, 0, 6, 0, 4, 0, 0, 0, 4, 0, 10, 0, 4, 0, 10, 0, 12, 0, 6, 0, 8, 0, 6, 0, 6, 0, 12, 0, 4, 0, 2, 0, 10, 0, 8, 0, -4, 0, 0, 0, 10, 0, 6, 0, 12, 0, 14, 0, 10, 0, 10, 0, 12, 0, 6, 0, 18, 0, 14, 0, 10, 0, 16, 0, 12, 0, 10, 0, 2, 0, 10, 0, 8, 0, 18, 0, 16, 0, 4
Offset: 1

Views

Author

Antti Karttunen, Aug 09 2018

Keywords

Crossrefs

Programs

  • PARI
    A002487(n) = { my(a=1, b=0); while(n>0, if(bitand(n, 1), b+=a, a+=b); n>>=1); (b); }; \\ From A002487
    A317839(n) = sumdiv(n,d,moebius(n/d)*A002487(d));

Formula

a(n) = Sum_{d|n} A008683(n/d)*A002487(d).
a(n) = A000010(n) - A317841(n).

A163659 L.g.f.: Sum_{n>=1} a(n)*x^n/n = log(S(x)/x) where S(x) is the g.f. of Stern's diatomic series (A002487).

Original entry on oeis.org

1, 3, -2, 7, 1, -6, 1, 15, -2, 3, 1, -14, 1, 3, -2, 31, 1, -6, 1, 7, -2, 3, 1, -30, 1, 3, -2, 7, 1, -6, 1, 63, -2, 3, 1, -14, 1, 3, -2, 15, 1, -6, 1, 7, -2, 3, 1, -62, 1, 3, -2, 7, 1, -6, 1, 15, -2, 3, 1, -14, 1, 3, -2, 127, 1, -6, 1, 7, -2, 3, 1, -30, 1, 3, -2, 7, 1, -6, 1, 31, -2, 3, 1, -14, 1
Offset: 1

Views

Author

Paul D. Hanna, Aug 02 2009

Keywords

Examples

			L.g.f.: log(S(x)/x) = x + 3*x^2/2 - 2*x^3/3 + 7*x^4/4 + x^5/5 - 6*x^6/6 +...
where S(x) is the g.f. of Stern's diatomic series (A002487):
S(x) = x + x^2 + 2*x^3 + x^4 + 3*x^5 + 2*x^6 + 3*x^7 + x^8 + 4*x^9 +...
		

Crossrefs

Programs

  • Mathematica
    a[ n_] := If[ n < 1, 0, Times @@ (Which[ # < 2, 1, # == 2, 2^(#2 + 1) - 1, # == 3, -2, True, 1] & @@@ FactorInteger[n])]; (* Michael Somos, Jun 27 2017 *)
  • PARI
    A002487(n)=local(c=1, b=0); while(n>0, if(bitand(n, 1), b+=c, c+=b); n>>=1); b
    {a(n)=n*polcoeff(log(sum(k=0,n,A002487(k+1)*x^k)+x*O(x^n)),n)}
    for(n=1, 64, print1(a(n), ", "))
    
  • PARI
    {a(n) = if( n<1, 0, if( n%3, 1, -2) * sigma(2 ^ valuation(n, 2)))}; /* Michael Somos, Feb 14 2011 */
    
  • PARI
    a(n)=local(X=x+x*O(x^n), A); A=log(1+X+X^2) + sum(k=0, #binary(n), log(1 + X^(2*2^k) + X^(4*2^k))); n*polcoeff(A, n)
    for(n=1, 64, print1(a(n), ", ")) \\ Paul D. Hanna, May 04 2014

Formula

a(2^n) = 2^(n+1) - 1 for n>=0.
a(n) is multiplicative with a(2^e) = 2^(e+1) - 1, a(3^e) = -2 if e>0, a(p^e) = 1 if p>3. - Michael Somos, Feb 14 2011
L.g.f.: Sum_{n>=0} log(1 + x^(2^n) + x^(2*2^n)) = Sum_{n>=1} a(n)*x^n/n. - Paul D. Hanna, May 04 2014
G.f.: Sum_{n>=0} 2^n * x^(2^n) * (1 + 2*x^(2^n)) / (1 + x^(2^n) + x^(2*2^n)). - Paul D. Hanna, May 04 2014
Dirichlet g.f.: zeta(s) * (1 - 3^(1-s)) / (1 - 2^(1-s)). - Amiram Eldar, Oct 24 2023

A212289 Record values in A002487.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 7, 8, 9, 11, 13, 14, 15, 18, 19, 21, 23, 26, 29, 30, 34, 37, 41, 47, 49, 50, 55, 60, 67, 69, 76, 79, 89, 97, 108, 109, 123, 128, 129, 131, 144, 157, 175, 178, 181, 199, 207, 208, 233, 254, 257, 283, 287, 322, 335, 337, 338, 343, 377, 411, 458, 465, 467, 474
Offset: 1

Views

Author

Keywords

Comments

Distinct elements of A270362. - Jeffrey Shallit, Mar 16 2016.

Crossrefs

Programs

  • Mathematica
    Union@ FoldList[Max, Nest[Append[#1, If[OddQ[#2], #1[[(#2 + 1)/2]], #1[[#2/2]] + #1[[(#2 + 2)/2]] ]] & @@ {#, Length@ # + 1} &, {0, 1}, 10^4]] (* Michael De Vlieger, Jul 10 2019 *)
  • PARI
    fusc(n)=my(a=1, b=0); while(n, if(n%2, b+=a, a+=b); n>>=1); b
    r=-1;for(n=0,1e5,t=fusc(n); if(t>r,r=t;print1(t", ")))
    
  • Python
    from itertools import count, islice
    from functools import reduce
    def A212289_gen(): # generator of terms
        yield (c:= 0)
        for n in count(1):
            m = 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)))
            if m>c: yield (c:=m)
    A212289_list = list(islice(A212289_gen(),30)) # Chai Wah Wu, Sep 23 2024

Formula

a(n) = fusc(A212288(n)).

Extensions

a(1)=0 prepended in terms, b-file and programs by Georg Fischer, Jun 24 2020

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

Original entry on oeis.org

1, 1, 3, 3, 3, 3, 3, 3, 5, 7, 7, 7, 7, 7, 7, 5, 5, 5, 7, 7, 11, 13, 7, 7, 7, 7, 13, 11, 7, 7, 5, 5, 7, 7, 13, 13, 15, 15, 15, 11, 11, 11, 13, 13, 13, 15, 15, 11, 11, 15, 15, 13, 13, 13, 11, 11, 11, 15, 15, 15, 13, 13, 7, 7, 7, 7, 15, 15, 15, 15, 13, 13, 15, 15, 27, 23, 23, 27, 15, 15, 15, 15, 27, 27, 29, 29, 31, 23, 21, 29, 31, 23, 23, 25, 11, 11, 11, 11, 25
Offset: 1

Views

Author

Antti Karttunen, Mar 21 2017

Keywords

Crossrefs

Odd bisection of A283976.
Cf. A283973 (positions where coincides with A007306, equally, with 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[BitOr[a[n - 1], a@ n], {n, 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)));
    for(n=1, 101, print1(bitor(A(n - 1), A(n))", ")) \\ Indranil Ghosh, Mar 23 2017
    
  • Python
    from functools import reduce
    def A283986(n): return 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)))|sum(reduce(lambda x,y:(x[0],x[0]+x[1]) if int(y) else (x[0]+x[1],x[1]),bin(n-1)[-1:2:-1],(1,0))) # Chai Wah Wu, May 05 2023
  • Scheme
    (define (A283986 n) (A003986bi (A002487 (- n 1)) (A002487 n))) ;; Where A003986bi implements bitwise-OR (A003986).
    

Formula

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

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

Original entry on oeis.org

1, 0, 3, 3, 2, 1, 1, 2, 5, 7, 6, 7, 7, 6, 7, 5, 4, 1, 3, 4, 11, 13, 2, 5, 5, 2, 13, 11, 4, 3, 1, 4, 7, 3, 12, 13, 15, 12, 13, 9, 8, 3, 5, 8, 9, 11, 14, 11, 11, 14, 11, 9, 8, 5, 3, 8, 9, 13, 12, 15, 13, 12, 3, 7, 6, 1, 13, 14, 11, 7, 4, 9, 11, 4, 25, 21, 22, 27, 7, 14, 13, 5, 24, 27, 29, 24, 31, 23, 20, 29, 31, 20, 23, 25, 2, 9, 9, 2, 25, 23, 20, 31, 29, 20, 23
Offset: 1

Views

Author

Antti Karttunen, Mar 21 2017

Keywords

Crossrefs

Odd bisection of A283977.
Cf. A283973 (positions where coincides with A007306, or equally, with A283986).

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[BitXor[a[n - 1], a@ n], {n, 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)));
    for(n=1, 120, print1(bitxor(A(n - 1), A(n)), ", ")) \\ Indranil Ghosh, Mar 23 2017
    
  • Python
    from functools import reduce
    def A283987(n): return 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)))^sum(reduce(lambda x,y:(x[0],x[0]+x[1]) if int(y) else (x[0]+x[1],x[1]),bin(n-1)[-1:2:-1],(1,0))) if n>1 else 1 # Chai Wah Wu, May 05 2023
  • Scheme
    (define (A283987 n) (A003987bi (A002487 (- n 1)) (A002487 n))) ;; Where A003987bi implements bitwise-XOR (A003987).
    

Formula

a(n) = A002487(n-1) XOR A002487(n), where XOR is bitwise-xor (A003987).
a(n) = A283986(n) - A283988(n).
a(n) = A007306(n) - 2*A283988(n).
a(n) = A283977((2*n)-1).

A283988 a(n) = A002487(n-1) AND A002487(n), where AND is bitwise-and (A004198).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Mar 21 2017

Keywords

Crossrefs

Odd bisection of A283978.
Cf. A283973 (positions of zeros), A283974 (nonzeros).

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[BitAnd[a[n - 1], a@ n], {n, 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)));
    for(n=1, 120, print1(bitand(A(n - 1), A(n)),", ")) \\ Indranil Ghosh, Mar 23 2017
    
  • Python
    from functools import reduce
    def A283988(n): return 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)))&sum(reduce(lambda x,y:(x[0],x[0]+x[1]) if int(y) else (x[0]+x[1],x[1]),bin(n-1)[-1:2:-1],(1,0))) if n>1 else 0 # Chai Wah Wu, May 05 2023
  • Scheme
    (define (A283988 n) (A004198bi (A002487 (- n 1)) (A002487 n)))  ;; Where A004198bi implements bitwise-AND (A004198).
    

Formula

a(n) = A002487(n-1) AND A002487(n), where AND is bitwise-and (A004198).
a(n) = A283986(n) - A283987(n).
a(n) = A007306(n) - A283986(n) = (A007306(n) - A283987(n))/2.
a(n) = A283978((2*n)-1).

A317837 a(n) = Sum_{d|n, dA002487(d).

Original entry on oeis.org

0, 1, 1, 2, 1, 4, 1, 3, 3, 5, 1, 7, 1, 5, 6, 4, 1, 10, 1, 9, 6, 7, 1, 10, 4, 7, 7, 9, 1, 16, 1, 5, 8, 7, 7, 17, 1, 9, 8, 13, 1, 20, 1, 13, 14, 9, 1, 13, 4, 15, 8, 13, 1, 22, 9, 13, 10, 9, 1, 26, 1, 7, 18, 6, 9, 22, 1, 13, 10, 23, 1, 24, 1, 13, 17, 17, 9, 26, 1, 17, 15, 13, 1, 34, 9, 15, 10, 19, 1, 40, 9, 17, 8, 11, 11
Offset: 1

Views

Author

Antti Karttunen, Aug 09 2018

Keywords

Crossrefs

Programs

  • PARI
    A002487(n) = { my(a=1, b=0); while(n>0, if(bitand(n, 1), b+=a, a+=b); n>>=1); (b); }; \\ From A002487
    A317837(n) = sumdiv(n,d,(dA002487(d));

Formula

a(n) = Sum_{d|n, dA002487(d).
a(n) = A317838(n) - A002487(n).
a(n) = A001222(A293216(n)).

A317841 Möbius transform of A284013 (= n - A002487(n)), where A002487 is Stern's Diatomic sequence.

Original entry on oeis.org

0, 1, 1, 2, 2, 2, 4, 4, 4, 4, 6, 4, 8, 6, 8, 8, 12, 6, 12, 8, 8, 10, 16, 8, 16, 12, 14, 12, 22, 8, 26, 16, 20, 16, 20, 12, 26, 18, 20, 16, 30, 12, 30, 20, 18, 22, 38, 16, 36, 20, 26, 24, 40, 18, 36, 24, 34, 28, 48, 16, 52, 30, 40, 32, 48, 20, 56, 32, 38, 24, 58, 24, 58, 36, 30, 36, 50, 24, 66, 32, 48, 40, 64, 24, 50, 42
Offset: 1

Views

Author

Antti Karttunen, Aug 09 2018

Keywords

Crossrefs

Programs

Formula

a(n) = Sum_{d|n} A008683(n/d)*A284013(d).
a(n) = A000010(n) - A317839(n).

A323889 Lexicographically earliest positive sequence such that a(i) = a(j) => A002487(i) = A002487(j) and A278222(i) = A278222(j), for all i, j >= 0.

Original entry on oeis.org

1, 2, 2, 3, 2, 4, 3, 5, 2, 6, 4, 7, 3, 7, 5, 8, 2, 9, 6, 10, 4, 11, 7, 12, 3, 10, 7, 13, 5, 12, 8, 14, 2, 15, 9, 16, 6, 17, 10, 18, 4, 17, 11, 19, 7, 20, 12, 21, 3, 16, 10, 22, 7, 19, 13, 23, 5, 18, 12, 23, 8, 21, 14, 24, 2, 25, 15, 26, 9, 27, 16, 28, 6, 29, 17, 30, 10, 31, 18, 32, 4, 27, 17, 33, 11, 34, 19, 35, 7, 31, 20, 36, 12, 37, 21, 38, 3, 26, 16, 39, 10, 33, 22
Offset: 0

Views

Author

Antti Karttunen, Feb 09 2019

Keywords

Comments

Restricted growth sequence transform of the ordered pair [A002487(n), A278222(n)].

Crossrefs

Cf. also A103391, A278243, A286378, A318311, A323892, A323897 and A324533 for a "deformed variant".

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; };
    A002487(n) = { my(a=1, b=0); while(n>0, if(bitand(n, 1), b+=a, a+=b); n>>=1); (b); }; \\ From A002487
    A005940(n) = { my(p=2, t=1); n--; until(!n\=2, if((n%2), (t*=p), p=nextprime(p+1))); t };
    A046523(n) = { my(f=vecsort(factor(n)[, 2], , 4), p); prod(i=1, #f, (p=nextprime(p+1))^f[i]); };  \\ From A046523
    A278222(n) = A046523(A005940(1+n));
    Aux323889(n) = [A002487(n), A278222(n)];
    v323889 = rgs_transform(vector(1+up_to,n,Aux323889(n-1)));
    A323889(n) = v323889[1+n];

Formula

a(2^n) = 2 for all n >= 0.
Previous Showing 11-20 of 384 results. Next