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-3 of 3 results.

A073089 a(n) = (1/2)*(4n - 3 - Sum_{k=1..n} A007400(k)).

Original entry on oeis.org

0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1
Offset: 1

Views

Author

Benoit Cloitre, Aug 18 2002

Keywords

Comments

From Joerg Arndt, Oct 28 2013: (Start)
Sequence is (essentially) obtained by complementing every other term of A014577.
Turns (by 90 degrees) of a curve similar to the Heighway dragon which can be rendered as follows: [Init] Set n=0 and direction=0. [Draw] Draw a unit line (in the current direction). Turn left/right if a(n) is zero/nonzero respectively. [Next] Set n=n+1 and goto (draw).
See the linked pdf files for two renderings of the curve. (End)

Examples

			From _Paul D. Hanna_, Oct 19 2012: (Start)
Let F(x) = x + 1/x + 1/x^3 + 1/x^7 + 1/x^15 + 1/x^31 +...+ 1/x^(2^n-1) +...
then F(x) = x + 1/(x + 1/(-x + 1/(-x + 1/(-x + 1/(x + 1/(x + 1/(-x + 1/(-x + 1/(x + 1/(-x + 1/(-x + 1/(x + 1/(x + 1/(x + 1/(-x + 1/(-x + 1/(x + 1/(-x + 1/(-x + 1/(-x + 1/(x +...+ 1/((-1)^a(n)*x +...)))))))))))))))))))))),
a continued fraction in which the partial quotients equal (-1)^a(n)*x.  (End)
		

Crossrefs

Cf. A007400, A073088 (the sum part here), A123725.

Programs

  • PARI
    a(n)=if(n<2,0,if(n%8==1,a((n+1)/2),[1,-1,0,1,1,1,0,0,1,-1,0,1,1,0,0,0][(n%16)+1])) \\ Ralf Stephan
    
  • PARI
    /* Using the Continued Fraction, Print 2^N terms of this sequence: */
    {N=10;CF=contfrac(x+sum(n=1,N,1/x^(2^n-1)),2^N);for(n=1,2^N,print1((1-CF[n]/x)/2,", "))} \\ Paul D. Hanna, Oct 19 2012
    
  • PARI
    a(n) = { if ( n<=1, return(0)); n-=1; my(v=2^valuation(n,2) ); return( (0==bitand(n, v<<1)) != (v%2) ); } \\ Joerg Arndt, Oct 28 2013

Formula

Recurrence: a(1) = a(4n+2) = a(8n+7) = a(16n+13) = 0, a(4n) = a(8n+3) = a(16n+5) = 1, a(8n+1) = a(4n+1).
G.f.: The following series has a simple continued fraction expansion:
x + Sum_{n>=1} 1/x^(2^n-1) = [x; x, -x, -x, -x, x, ..., (-1)^a(n)*x, ...]. - Paul D. Hanna, Oct 19 2012
a(n) = A014577(n-2) + A056594(n). Conjecture: a(n) = (1 + (-1)^A057661(n - 1))/2 for all n > 1. - Velin Yanev, Feb 01 2021

A123726 Denominators of fractional partial quotients appearing in a continued fraction for the power series Sum_{n>=0} x^(2^n - 1)/(n+1)^s.

Original entry on oeis.org

1, 1, 4, 1, 9, 1, 4, 1, 16, 1, 4, 1, 9, 1, 4, 1, 25, 1, 4, 1, 9, 1, 4, 1, 16, 1, 4, 1, 9, 1, 4, 1, 36, 1, 4, 1, 9, 1, 4, 1, 16, 1, 4, 1, 9, 1, 4, 1, 25, 1, 4, 1, 9, 1, 4, 1, 16, 1, 4, 1, 9, 1, 4, 1, 49, 1, 4, 1, 9, 1, 4, 1, 16, 1, 4, 1, 9, 1, 4, 1, 25, 1, 4, 1, 9, 1, 4, 1, 16, 1, 4, 1, 9, 1, 4, 1, 36, 1, 4
Offset: 0

Views

Author

Paul D. Hanna, Oct 12 2006

Keywords

Comments

A123725(n) = (A007814(n) + 2)*(-1)^A073089(n+1) are the numerators of the partial quotients.

Examples

			Surprisingly, the following analog of the Riemann zeta function:
Z(x,s) = Sum_{n>=0} x^(2^n-1)/(n+1)^s = 1 + x/2^s + x^3/3^s +x^7/4^s+..
may be expressed by the continued fraction:
Z(x,s) = [1; f(1)^s/x, -f(2)^s/x, -f(3)^s/x,...,f(n)^s*(-1)^e(n)/x,...]
such that the (2^n-1)-th convergent = Sum_{k=0..n} x^(2^k-1)/(k+1)^s,
where f(n) = (b(n)+2)/(b(n)+1)^2 and e(n) = A073089(n+1) for n>=1,
and b(n) = A007814(n) the exponent of highest power of 2 dividing n.
		

Crossrefs

Cf. A123725 (numerators), A007814, A073089, A001511.

Programs

  • Magma
    [1] cat [(Valuation(n, 2) + 1)^2: n in [1..50]]; // G. C. Greubel, Nov 01 2018
  • Mathematica
    Join[{1}, Table[(1 + IntegerExponent[n, 2])^2, {n, 1, 50}]] (* G. C. Greubel, Nov 01 2018 *)
  • PARI
    {a(n)=denominator(subst(contfrac(sum(m=0,#binary(n),1/x^(2^m-1)/(m+1)),n+3)[n+1],x,1))}
    
  • PARI
    /* a(n) = (A007814(n)+1)^2: */ {a(n)=if(n==0,1,(valuation(n,2)+1)^2)}
    

Formula

a(n) = (A007814(n) + 1)^2 = A001511(n)^2 for n>=1, with a(0)=1, where A007814(n) is the exponent of the highest power of 2 dividing n.
Multiplicative with a(2^e) = (e + 1)^2, a(p^e) = 1 for odd prime p. - Andrew Howroyd, Jul 31 2018
From Amiram Eldar, Dec 29 2022: (Start)
Dirichlet g.f.: zeta(s)*(4^s+2^s)/(2^s-1)^2.
Sum_{k=1..n} a(k) ~ 6*n. (End)

Extensions

Ref to A001511 added by Franklin T. Adams-Watters, Dec 22 2013

A371402 a(n) = gcd(2*n, 4^n)^(2*n + 1) mod (2^(2*n + 1) - 1)^2.

Original entry on oeis.org

0, 8, 63, 128, 1534, 2048, 16383, 32768, 524285, 524288, 4194303, 8388608, 100663294, 134217728, 1073741823, 2147483648, 42949672956, 34359738368, 274877906943, 549755813888, 6597069766654, 8796093022208, 70368744177663, 140737488355328, 2251799813685245
Offset: 0

Views

Author

Peter Luschny, Mar 26 2024

Keywords

Crossrefs

Programs

  • Maple
    a := n -> modp(igcd(2*n, 4^n)^(2*n + 1), (2^(2*n + 1) - 1)^2):
    seq(a(n), n = 0..19);
  • PARI
    a(n) = lift(Mod(gcd(2*n, 4^n),(2^(2*n + 1) - 1)^2)^(2*n + 1)); \\ Michel Marcus, Mar 27 2024
    
  • Python
    def A371402(n): return ((~n & n-1).bit_length()+2<<(n<<1) if n&1 else ((m:=(~n & n-1).bit_length())+1<<(n<<1)+1)-m) if n else 0 # Chai Wah Wu, Mar 27 2024
  • SageMath
    def v2(n): return valuation(2*n, 2)
    def a(n):
        if n == 0: return 0
        return 4^n*(v2(n) + 1) if n % 2 else 2*4^n*v2(n) - v2(n//2)
    print([a(n) for n in range(0, 25)])
    

Formula

a(2*n) = 2*4^(2*n)*A001511(2*n) - A001511(n) for n >= 1.
a(2*n+1) = 4^(2*n + 1)*(A001511(2*n + 1) + 1) for n >= 1.
Showing 1-3 of 3 results.