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 21-30 of 32 results. Next

A059129 A hierarchical sequence (W2{2}* - see A059126).

Original entry on oeis.org

1, 2, 1, 2, 3, 2, 1, 2, 1, 3, 4, 3, 1, 2, 1, 2, 3, 2, 1, 2, 1, 4, 5, 4, 1, 2, 1, 2, 3, 2, 1, 2, 1, 3, 4, 3, 1, 2, 1, 2, 3, 2, 1, 2, 1, 5, 6, 5, 1, 2, 1, 2, 3, 2, 1, 2, 1, 3, 4, 3, 1, 2, 1, 2, 3, 2, 1, 2, 1, 4, 5, 4, 1, 2, 1, 2, 3, 2, 1, 2, 1, 3, 4, 3, 1, 2, 1, 2, 3, 2, 1, 2, 1, 6, 7, 6, 1, 2, 1, 2, 3, 2, 1, 2, 1
Offset: 0

Views

Author

Jonas Wallgren, Jan 19 2001

Keywords

Comments

Begin with the empty finite sequence s_0. Inductively extend s_n to obtain s_{n+1} as follows: if s_n is given by a, b, c, ..., d, e, f, with g being the least integer that is not a value of s_n, then s_{n+1} is a, b, c, ..., d, e, f, g, -f, -e, -d, ..., -c, -d, -a, -g. The terms of {a(n)} give the absolute values of the limit of these sequences. These finite sequences naturally describe elements of fundamental groups occurring in picture-hanging puzzles and Brunnian links. - Thomas Anton, Oct 15 2022

Crossrefs

A204617 Multiplicative with a(p^e) = p^(e-1)*H(p). H(2) = 1, H(p) = p - 1 if p == 1 (mod 4) and H(p) = p + 1 if p == 3 (mod 4).

Original entry on oeis.org

1, 1, 4, 2, 4, 4, 8, 4, 12, 4, 12, 8, 12, 8, 16, 8, 16, 12, 20, 8, 32, 12, 24, 16, 20, 12, 36, 16, 28, 16, 32, 16, 48, 16, 32, 24, 36, 20, 48, 16, 40, 32, 44, 24, 48, 24, 48, 32, 56, 20, 64, 24, 52, 36, 48, 32, 80, 28, 60, 32, 60, 32, 96, 32, 48, 48, 68, 32
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Maple
    with(numtheory):
    a := n->add(jacobi(-1,d)*mobius(d)*n/d, d in divisors(n)):
    seq(a(n), n = 1..60); # Peter Bala, Dec 26 2023
  • Mathematica
    ar[p_,s_] := Which[Mod[p,4]==1, p^(s-1)*(p-1), Mod[p,4]==3, p^(s-1)*(p+1), True,p^(s-1)]; arit[1] = 1; arit[n_] := Product[ar[FactorInteger[n][[i,1]], FactorInteger[n][[i,2]]], {i, Length[FactorInteger[n]]}]; Array[arit, 100]
  • PARI
    A204617(n) = { my(f=factor(n),p); prod(i=1, #f~, p=f[i, 1]; (p^(f[i, 2]-1)) * if(2==p,1,if(1==(p%4),p-1,p+1))); }; \\ Antti Karttunen, Nov 16 2021

Formula

a(n) = phi(n) if n is in A072437.
Sum_{k=1..n} a(k) ~ c * n^2, where c = (3/8) * Product_{primes p == 1 (mod 4)} (1 - 1/p^2) * Product_{primes p == 3 (mod 4)} (1 + 1/p^2) = 3*A243381/(8*A175647) = 0.409404... . - Amiram Eldar, Dec 24 2022
a(n) = n*Product_{primes p, p | n} (1 - A034947(p)/p) = Sum_{d | n} A034947(d)* mobius(d)*n/d. Cf. A000010(n) = Sum_{d | n} mobius(d)*n/d. - Peter Bala, Dec 26 2023
a(n) = A079458(n)/A062570(n). - Ridouane Oudra, Jun 04 2024

A322016 a(0) = 0; for n > 0, if A003188(n) > A003188(n-1) then a(n) = n-1, otherwise a(n) = 0.

Original entry on oeis.org

0, 0, 1, 0, 3, 4, 0, 0, 7, 8, 9, 0, 0, 12, 0, 0, 15, 16, 17, 0, 19, 20, 0, 0, 0, 24, 25, 0, 0, 28, 0, 0, 31, 32, 33, 0, 35, 36, 0, 0, 39, 40, 41, 0, 0, 44, 0, 0, 0, 48, 49, 0, 51, 52, 0, 0, 0, 56, 57, 0, 0, 60, 0, 0, 63, 64, 65, 0, 67, 68, 0, 0, 71, 72, 73, 0, 0, 76, 0, 0, 79, 80, 81, 0, 83, 84, 0, 0, 0, 88, 89, 0, 0, 92, 0, 0, 0, 96, 97
Offset: 0

Views

Author

Antti Karttunen, Nov 24 2018

Keywords

Crossrefs

Programs

Formula

a(0) = 0; for n > 0, a(n) = (1/2)*(A034947(n)+1)*(n-1).

A337821 For n >= 0, a(4n+1) = 0, a(4n+3) = a(2n+1) + 1, a(2n+2) = a(n+1).

Original entry on oeis.org

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

Views

Author

Peter Munn, Sep 23 2020

Keywords

Comments

This sequence is the ruler sequence A007814 interleaved with this sequence; specifically, the odd bisection is A007814, the even bisection is the sequence itself.
The 3-adic valuation of the Doudna sequence (A005940).
The 2-adic valuation of Kimberling's paraphrase (A003602) of the binary number system. [Edited Peter Munn, Aug 13 2025.]

Examples

			Start of table showing the interleaving with ruler sequence, A007814:
   n  a(n)  A007814    a(n/2)
            ((n+1)/2)
   1   0       0
   2   0                 0
   3   1       1
   4   0                 0
   5   0       0
   6   1                 1
   7   2       2
   8   0                 0
   9   0       0
  10   0                 0
  11   1       1
  12   1                 1
  13   0       0
  14   2                 2
  15   3       3
  16   0                 0
  17   0       0
  18   0                 0
  19   1       1
  20   0                 0
  21   0       0
  22   1                 1
  23   2       2
  24   1                 1
		

Crossrefs

Odd bisection: A007814.
A000265, A003602, A005940, A007949 are used in a formula defining this sequence.
Positions of zeros: A091072.
Sequences with similar interleaving: A089309, A014577, A025480, A034947, A038189, A082392, A099545, A181363, A274139.

Programs

  • Mathematica
    a[n_] := IntegerExponent[(n/2^IntegerExponent[n, 2] + 1)/2, 2]; Array[a, 100] (* Amiram Eldar, Sep 30 2020 *)
  • PARI
    a(n) = valuation(n>>valuation(n,2)+1, 2) - 1; \\ Kevin Ryde, Apr 06 2024

Formula

a(2*n) = a(n).
a(2*n+1) = A007814(n+1).
a(n) = A007949(A005940(n)).
a(n) = A007814(A003602(n)) = A007814((A000265(n)+1) / 2) = A089309(n) - 1.
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = 1. - Amiram Eldar, Sep 13 2024

A371594 Starting positions of runs in the paperfolding sequence A014707.

Original entry on oeis.org

1, 3, 4, 6, 8, 11, 13, 14, 16, 19, 20, 22, 25, 27, 29, 30, 32, 35, 36, 38, 40, 43, 45, 46, 49, 51, 52, 54, 57, 59, 61, 62, 64, 67, 68, 70, 72, 75, 77, 78, 80, 83, 84, 86, 89, 91, 93, 94, 97, 99, 100, 102, 104, 107, 109, 110, 113, 115, 116, 118, 121, 123, 125
Offset: 1

Views

Author

Jeffrey Shallit, Mar 28 2024

Keywords

Comments

A "run" is a maximal block of consecutive identical terms. The paperfolding sequence A014707 is more usually indexed starting at position 1, not 0, and this choice is reflected in the sequence (cf. A034947).

Examples

			The first few terms of A014707 are 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, and runs begin at positions 1, 3, 4, 6, 8, 11, 13, 14, ...
		

Crossrefs

Programs

  • Mathematica
    Abs@ SplitBy[Array[#  KroneckerSymbol[-1, #] &, 120], Sign][[All, 1]] (* Michael De Vlieger, Mar 28 2024 *)
  • PARI
    a(n) = if(n==1,1, n--; 2*n + bitxor(bittest(n,0), bittest(n,valuation(n,2)+1))); \\ Kevin Ryde, Apr 06 2024
  • Python
    # DFA transition function and simulation
    d = { (0,0):0, (0,1):1, (1,0):2, (1,1):3, (2,0):4, (2,1):5,
          (3,0):6, (3,1):7, (4,0):4, (4,1):5, (5,0):2, (5,1):3,
          (6,0):0, (6,1):1, (7,0):6, (7,1):7 }
    def ok(n):
        q, w = 0, map(int, bin(n)[2:])
        for c in w: q = d[q, c]
        return q in {1, 3, 4, 6}
    print([k for k in range(126) if ok(k)]) # Michael S. Branicky, Mar 28 2024
    
  • Python
    # using formula and function in A014707
    def a(n): return 2*n-1 - (n + A014707(n-2))%2 if n>=2 else 1
    print([a(n) for n in range(1, 64)]) # Michael S. Branicky, Mar 29 2024
    

Formula

The automaton accompanying this entry accepts exactly the base-2 representations of the terms of this sequence.
a(n) = 2*n-1 - ((n + A014707(n-2)) mod 2), for n >= 2. - Kevin Ryde, Mar 28 2024

A112347 Kronecker symbol (-1, n) except a(0) = 0.

Original entry on oeis.org

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

Views

Author

Michael Somos, Sep 12 2005

Keywords

Examples

			x + x^2 - x^3 + x^4 + x^5 - x^6 - x^7 + x^8 + x^9 + x^10 - x^11 - x^12 + x^13 + ...
		

Crossrefs

Cf. A034947.
First differences of A005811.

Programs

  • Mathematica
    Join[{0},KroneckerSymbol[-1,Range[110]]] (* Harvey P. Dale, Jun 02 2019 *)
  • PARI
    {a(n) = if( n, kronecker( -1, n))}

Formula

Multiplicative with a(2^e) = 1, a(p^e) = (-1)^(e(p-1)/2) if p>2.
a(2n) = a(n), a(4*n + 1) = 1, a(4*n + 3) = -1. a(-n) = -a(n).
a(n) = A034947(n) unless n=0.

A317627 a(n) = A317253 - floor(8*n/3).

Original entry on oeis.org

2, 3, 1, 1, 3, 1, 2, 1, -1, 1, 3, 1, 2, 3, 1, 1, 1, -1, 2, 1, -1, 1, 3, 1, 2, 3, 1, 1, 3, 1, 2, 1, -1, 1, 1, -1, 2, 3, 1, 1, 1, -1, 2, 1, -1, 1, 3, 1, 2, 3, 1, 1, 3, 1, 2, 1, -1, 1, 3, 1, 2, 3, 1, 1, 1, -1, 2, 1, -1, 1, 1, -1, 2, 3, 1, 1, 3, 1, 2
Offset: 1

Views

Author

A.H.M. Smeets, Aug 02 2018

Keywords

Crossrefs

Programs

  • Python
    n,f,i,p,q,base = 1,1,0,0,1,3
    while i < 100000:
        i,p,q = i+1,p*base,q*base
        if i == f:
            p,n = p+1,n+1
            f = f*n
    n,a,j = 0,0,0
    while p%q > 0:
        a,f,p,q = a+1,p//q,q,p%q
        if f == 1:
            n = n+1
            print(n,a-1-(8*n//3))

Formula

a(3*n+1) = 2 - (n mod 2) for n >= 0, a(6*n+2) = 3 - 2*(n mod 2) and a(6*n+5) = a(3*n+2) for n >= 0, a(6*n+3) = 1 - 2*(n mod 2) and a(6*n+6) = a(3*n+3) for n >= 0.
a(3*n+1) = A000034(n+1) for n >= 0.
a(3*n+2) = A089607(n) for n > 1.
a(3*n+2) = 2*A014577(n-1)+1 for n > 0.
a(3*n+3) = A034947(n) = 2*A014577(n-1)-1 for n > 0.

A143347 Decimal expansion of the paper-folding constant, or the dragon constant.

Original entry on oeis.org

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

Views

Author

Eric W. Weisstein, Aug 09 2008

Keywords

Comments

Named "the Gaussian Liouville number" by Borwein and Coons (2008). - Amiram Eldar, Apr 29 2021

Examples

			0.85073618820186726036...
		

References

  • Chandler Davis and Donald E. Knuth, Number Representations and Dragon Curves -- I and II, Journal of Recreational Mathematics, volume 3, number 2, April 1970, pages 66-81, and number 3, July 1970, pages 133-149. Reprinted in Donald E. Knuth, Selected Papers on Fun and Games, CSLI Publications, 2010, pages 571-614.
  • Steven R. Finch, Mathematical Constants, Cambridge University Press, 2003, section 6.8.5 Paper Folding, pages 439-440.

Crossrefs

Cf. A014577 (binary expansion), A034947.

Programs

  • Mathematica
    RealDigits[ N[ Sum[ 8^2^k/(2^2^(k + 2) - 1), {k, 0, Infinity}], 110]][[1]][[1 ;; 105]] (* Jean-François Alcover, Oct 26 2012 *)
  • PARI
    default(realprecision,510);
    c=sum(k=0, 10, 1.0/( 2^(2^k) * ( 1 - 1/(2^(2^(k+2))) ) ) )
    /* Joerg Arndt, Aug 28 2011 */

Formula

Equals Sum_{k>=1} A014577(k)/2^k = Sum_{k>=1} (1+A034947(k))/2^(k+1). - Amiram Eldar, Apr 29 2021

A286299 First differences of A286298.

Original entry on oeis.org

1, 2, -1, 2, 1, -1, -1, 2, 1, 1, -1, -1, 1, -1, -1, 2, 1, 1, -1, 1, 1, -1, -1, -1, 1, 1, -1, -1, 1, -1, -1, 2, 1, 1, -1, 1, 1, -1, -1, 1, 1, 1, -1, -1, 1, -1, -1, -1, 1, 1, -1, 1, 1, -1, -1, -1, 1, 1, -1, -1, 1, -1, -1, 2, 1, 1
Offset: 0

Views

Author

N. J. A. Sloane, Jun 02 2017

Keywords

Comments

A014577 is obtained if sequence terms are changed as follows: 2's replaced by 1's and -1's replaced by 0's. - Karyn McLellan, Aug 16 2018

Crossrefs

Cf. A286298.

Formula

a(n) = 2*A034947(n) if n = 2^k for k>1, otherwise a(n) = A034947(n). - Karyn McLellan, Aug 16 2018

A323378 Square array read by antidiagonals: T(n,k) = Kronecker symbol (-n/k), n >= 1, k >= 1.

Original entry on oeis.org

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

Views

Author

Jianing Song, Jan 12 2019

Keywords

Comments

If A215200 is arranged into a square array A215200(n,k) = kronecker symbol(n/k) with n >= 0, k >= 1, then this sequence gives the other half of the array.
Note that there is no such n such that the n-th row and the n-th column are the same.

Examples

			Table begins
  1,  1, -1,  1,  1, -1, -1,  1,  1,  1, ... ((-1/k) = A034947)
  1,  0,  1,  0, -1,  0, -1,  0,  1,  0, ... ((-2/k) = A188510)
  1, -1,  0,  1, -1,  0,  1, -1,  0,  1, ... ((-3/k) = A102283)
  1,  0, -1,  0,  1,  0, -1,  0,  1,  0, ... ((-4/k) = A101455)
  1, -1,  1,  1,  0, -1,  1, -1,  1,  0, ... ((-5/k) = A226162)
  1,  0,  0,  0,  1,  0,  1,  0,  0,  0, ... ((-6/k) = A109017)
  1,  1, -1,  1, -1, -1,  0,  1,  1, -1, ... ((-7/k) = A175629)
  1,  0,  1,  0, -1,  0, -1,  0,  1,  0, ... ((-8/k) = A188510)
  ...
		

Crossrefs

Cf. A215200.
The first rows are listed in A034947, A188510, A102283, A101455, A226162, A109017, A175629, A188510, ...

Programs

  • PARI
    T(n,k) = kronecker(-n, k)
Previous Showing 21-30 of 32 results. Next