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

A112049 a(n) = position of A112046(n) in A000040.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Aug 27 2005

Keywords

Comments

A112051 gives the first positions of distinct new values in this sequence, that seem also to be the positions of the first occurrence of each n, and thus the positions of the records. Compare also to A084921. - Antti Karttunen, May 26 2017

Crossrefs

Cf. A286579 (ordinal transform).

Programs

  • Mathematica
    a112046[n_]:=Block[{i=1},While[JacobiSymbol[i, 2n + 1]==1, i++]; i];a049084[n_]:=If[PrimeQ[n], PrimePi[n], 0]; Table[a049084[a112046[n]], {n, 102}] (* Indranil Ghosh, May 11 2017 *)
  • PARI
    A112049(n) = for(i=1, (2*n), if((kronecker(i, (n+n+1)) < 1), return(primepi(i)))); \\ Antti Karttunen, May 26 2017
    
  • Python
    from sympy import jacobi_symbol as J, isprime, primepi
    def a049084(n):
        return primepi(n) if isprime(n) else 0
    def a112046(n):
        i=1
        while True:
            if J(i, 2*n + 1)!=1: return i
            else: i+=1
    def a(n): return a049084(a112046(n))
    print([a(n) for n in range(1, 103)]) # Indranil Ghosh, May 11 2017

Formula

a(n) = A049084(A112046(n)).

Extensions

Unnecessary fallback-clause removed from the name by Antti Karttunen, May 26 2017

A112053 a(n) = A112046(2n) - A112046(2n-1) = A112048(n) - A112047(n).

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, -2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, -2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, -6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Offset: 1

Views

Author

Antti Karttunen, Aug 27 2005

Keywords

Crossrefs

Indices where a(n) is not zero: A112054. Values at those points: A112059.

Programs

  • Mathematica
    a112046[n_]:=Block[{i=1}, While[JacobiSymbol[i, 2n + 1]==1, i++]; i]; Table[a112046[2n] - a112046[2n - 1] , {n, 101}] (* Indranil Ghosh, May 24 2017 *)
  • Python
    from sympy import jacobi_symbol as J
    def a112046(n):
        i=1
        while True:
            if J(i, 2*n + 1)!=1: return i
            else: i+=1
    def a(n): return a112046(2*n) - a112046(2*n - 1)
    print([a(n) for n in range(1, 102)]) # Indranil Ghosh, May 24 2017

Formula

a(n) = A112048(n)-A112047(n).

A112047 Bisection of A112046.

Original entry on oeis.org

2, 3, 2, 3, 2, 5, 2, 3, 2, 3, 2, 5, 2, 3, 2, 3, 2, 7, 2, 3, 2, 3, 2, 5, 2, 3, 2, 3, 2, 7, 2, 3, 2, 3, 2, 5, 2, 3, 2, 3, 2, 5, 2, 3, 2, 3, 2, 7, 2, 3, 2, 3, 2, 5, 2, 3, 2, 3, 2, 7, 2, 3, 2, 3, 2, 5, 2, 3, 2, 3, 2, 5, 2, 3, 2, 3, 2, 11, 2, 3, 2, 3, 2, 5, 2, 3, 2, 3, 2, 7, 2, 3, 2, 3, 2, 5, 2, 3, 2, 3, 2, 5
Offset: 1

Views

Author

Antti Karttunen, Aug 27 2005

Keywords

Crossrefs

Programs

  • Mathematica
    a112046[n_]:=Block[{i=1},While[JacobiSymbol[i, 2n + 1]==1, i++]; i]; Table[a112046[2n - 1], {n, 102}] (* Indranil Ghosh, May 11 2017 *)
  • Python
    from sympy import jacobi_symbol as J
    def a112046(n):
        i=1
        while True:
            if J(i, 2*n + 1)!=1: return i
            else: i+=1
    print([a112046(2*n - 1) for n in range(1, 103)]) # Indranil Ghosh, May 11 2017

Formula

a(n) = A112046(2n-1)

A112048 Bisection of A112046.

Original entry on oeis.org

2, 3, 2, 3, 2, 5, 2, 3, 2, 3, 2, 7, 2, 3, 2, 3, 2, 5, 2, 3, 2, 3, 2, 5, 2, 3, 2, 3, 2, 11, 2, 3, 2, 3, 2, 5, 2, 3, 2, 3, 2, 13, 2, 3, 2, 3, 2, 5, 2, 3, 2, 3, 2, 5, 2, 3, 2, 3, 2, 7, 2, 3, 2, 3, 2, 5, 2, 3, 2, 3, 2, 17, 2, 3, 2, 3, 2, 5, 2, 3, 2, 3, 2, 5, 2, 3, 2, 3, 2, 19, 2, 3, 2, 3, 2, 5, 2, 3, 2, 3, 2
Offset: 1

Views

Author

Antti Karttunen, Aug 27 2005

Keywords

Crossrefs

Programs

  • Mathematica
    a112046[n_]:=Block[{i=1}, While[JacobiSymbol[i, 2n + 1]==1, i++]; i]; Table[a112046[2n] , {n, 101}] (* Indranil Ghosh, May 24 2017 *)
  • Python
    from sympy import jacobi_symbol as J
    def a112046(n):
        i=1
        while True:
            if J(i, 2*n + 1)!=1: return i
            else: i+=1
    def a(n): return a112046(2*n)
    print([a(n) for n in range(1, 102)])  # Indranil Ghosh, May 24 2017

Formula

a(n) = A112046(2n).

A112051 a(1)=1, a(n) = first index i (> a(n-1)), where A112046(i) gets a value distinct from any values A112046(1)..A112046(a(n-1)).

Original entry on oeis.org

1, 3, 11, 24, 60, 84, 144, 180, 264, 420, 480, 684, 840, 924, 1104, 1404, 1740, 1860, 2244, 2520, 2664, 3120, 3444, 3960, 4704, 5100, 5304, 5724, 5940, 6384, 8064, 8580, 9384, 9660, 11100, 11400, 12324, 13284, 13944, 14964, 16020, 16380, 18240
Offset: 1

Views

Author

Antti Karttunen, Aug 27 2005

Keywords

Crossrefs

Column 1 of A112060 (row 1 of A112061). Cf. A112052.

A112060 Square array A(x,y) = y-th natural number k for which A112049(k)=x and 0 if no such k exists; read by antidiagonals A(1,1), A(2,1), A(1,2), A(3,1), A(2,2), ...

Original entry on oeis.org

1, 2, 3, 5, 4, 11, 6, 7, 12, 24, 9, 8, 23, 35, 60, 10, 15, 36, 59, 155, 84, 13, 16, 47, 95, 275, 239, 144, 14, 19, 48, 119, 335, 575, 779, 180, 17, 20, 71, 120, 359, 659, 1499, 2855, 264, 18, 27, 72, 179, 419, 839, 1535, 4199, 5279, 420, 21, 28, 83, 204, 504
Offset: 1

Views

Author

Antti Karttunen, Aug 27 2005

Keywords

Comments

This is a permutation of natural numbers provided that the sequence A112046 contains only prime values [which is true] and every prime occurs infinitely many times there.

Examples

			The top left corner of the array:
   1,  2,  5,  6,  9, 10, ...
   3,  4,  7,  8, 15, 16, ...
  11, 12, 23, 36, 47, ...
		

Crossrefs

A112070(x, y) = 2*A(X, Y)+1. Transpose: A112061. Column 1: A112051. Row 1: A042963, Row 2: A112062, Row 3: A112063, Row 4: A112064, Row 5: A112065, Row 6: A112066, Row 7: A112067, Row 8: A112068, Row 9: A112069.
Cf. also A227196.

A112070 Square array A(x,y) = y-th odd number 2i+1 (i>=1) for which A112049(2i+1)=x, or 0 if no such i exists; read by descending antidiagonals.

Original entry on oeis.org

3, 5, 7, 11, 9, 23, 13, 15, 25, 49, 19, 17, 47, 71, 121, 21, 31, 73, 119, 311, 169, 27, 33, 95, 191, 551, 479, 289, 29, 39, 97, 239, 671, 1151, 1559, 361, 35, 41, 143, 241, 719, 1319, 2999, 5711, 529, 37, 55, 145, 359, 839, 1679, 3071, 8399, 10559, 841, 43, 57
Offset: 1

Views

Author

Antti Karttunen, Aug 27 2005

Keywords

Comments

This is a permutation of odd numbers greater than unity provided that the sequence A112046 contains only prime values and every prime occurs infinitely many times there. Because the Jacobi symbol is multiplicative with respect to its modulus, it follows that if n occurs on row i and m occurs on row j, then n*m cannot occur before row min(i,j).

Examples

			The top left corner of the array:
3,5,11,13,19,21,...
7,9,15,17,31,33,...
23,25,47,73,95,...
		

Crossrefs

A(x, y) = 2*A112060(x, y)+1. Transpose: A112071. Column 1: A112052. Row 1: A047621, Row 2: A112072 Row 3: A112073, Row 4: A112074, Row 5: A112075, Row 6: A112076, Row 7: A112077, Row 8: A112078, Row 9: A112079.

A112054 Indices where A112053 is not zero.

Original entry on oeis.org

12, 18, 30, 42, 48, 72, 78, 90, 102, 108, 120, 132, 138, 162, 168, 180, 192, 198, 210, 222, 228, 240, 252, 258, 282, 288, 300, 312, 318, 330, 342, 348, 372, 378, 390, 402, 408, 420, 432, 438, 450, 462, 468, 492, 498, 510, 522, 528, 540, 552, 558, 582, 588
Offset: 1

Views

Author

Antti Karttunen, Aug 27 2005

Keywords

Comments

These are all divisible by 6, as J(2,m) = +1 if m = 1 or 7 mod 8 and -1 if m = 3 or 5 mod 8 and J(3,m) = +1 if m = 1 or 11 mod 12, -1 if m = 5 or 7 mod 12 and 0 if m = 3 or 9 mod 12 (where Jacobi symbol J(i,m) returns +1 if i is quadratic residue modulo odd number m), it follows that only when i=24*n it holds that J(2,i-1)=J(2,i+1)=J(3,i-1)=J(3,i+1)=+1 and thus only then the function A112046 (and A112053) depends on values of J(k>3,m).

Crossrefs

Cf. A112058(n) = 4*a(n). A112055(n) = a(n)/6.

Programs

  • Mathematica
    a112046[n_]:=Block[{i=1}, While[JacobiSymbol[i, 2n + 1]==1, i++]; i]; Select[Range[1000], a112046[2#] - a112046[2# - 1] != 0 &] (* Indranil Ghosh, May 24 2017 *)
  • Python
    from sympy import jacobi_symbol as J
    def a112046(n):
        i=1
        while True:
            if J(i, 2*n + 1)!=1: return i
            else: i+=1
    def a(n): return a112046(2*n) - a112046(2*n - 1)
    print([n for n in range(1, 1001) if a(n)!=0]) # Indranil Ghosh, May 24 2017

A227196 a(n) = first i >= 1 for which the Kronecker symbol K(i,n) is not +1 (i.e., is either 0 or -1), 0 if no such i exists.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Jul 06 2013

Keywords

Comments

a(1) = 0, because K(i,1) is 1 for all i. After that, A112046 interleaved with A007395.
All terms beyond a(1) = 0 are prime numbers. Heuristically a(n) is 2 3/4 of the time, 3 1/6 of the time, 5 1/20 of the time, 7 2/105 of the time, etc. The average value is 2.5738775742512.... - Charles R Greathouse IV, Jan 30 2018

Crossrefs

Bisections: A112046 (for odd terms from 3 onward), A007395 (all even terms).

Programs

  • PARI
    a(n) = for(k=1,n,if(kronecker(k,n)<1, return(k)))
    for(n=1,120, print1(a(n),", "))

Formula

A227195(n) = a(n)-1 for all n>=2.
a(2n+1) = A112046(n) for all n>0. - A.H.M. Smeets Jan 29 2018

A286465 Compound filter: a(1) = 1, a(n) = P(A112049(n-1), A278223(n)), where P(n,k) is sequence A000027 used as a pairing function.

Original entry on oeis.org

1, 2, 2, 5, 12, 2, 2, 23, 5, 2, 16, 9, 18, 29, 2, 5, 23, 16, 2, 23, 5, 2, 67, 9, 25, 16, 2, 23, 23, 2, 2, 80, 23, 2, 16, 14, 9, 67, 16, 5, 138, 2, 16, 23, 5, 16, 16, 31, 9, 67, 2, 5, 467, 2, 2, 23, 5, 16, 67, 40, 33, 16, 29, 5, 23, 2, 16, 302, 5, 2, 16, 31, 31, 67, 2, 5, 80, 16, 2, 23, 23, 2, 436, 9, 42, 67, 2, 80, 23, 2, 2, 23, 23, 16, 277, 14, 9, 436, 2, 5
Offset: 1

Views

Author

Antti Karttunen, May 10 2017

Keywords

Comments

After a(1) = 1, the information combined together to a(n) consists of A046523(2n-1), giving essentially the prime signature of 2n-1, and the index of the first prime p >= 1 for which the Jacobi symbol J(p,2n-1) is not +1 (i.e. is either 0 or -1), the value which is returned by A112049(n-1).

Crossrefs

Programs

  • PARI
    A112049(n) = for(i=1,(2*n),if((kronecker(i,(n+n+1)) < 1),return(primepi(i))));
    A046523(n) = { my(f=vecsort(factor(n)[, 2], , 4), p); prod(i=1, #f, (p=nextprime(p+1))^f[i]); };  \\ This function from Charles R Greathouse IV, Aug 17 2011
    A286465(n) = if(1==n,n,(1/2)*(2 + ((A112049(n-1)+A046523((2*n)-1))^2) - A112049(n-1) - 3*A046523((2*n)-1)));
    for(n=1, 10000, write("b286465.txt", n, " ", A286465(n)));
    
  • Python
    from sympy import jacobi_symbol as J, factorint, isprime, primepi
    def P(n):
        f = factorint(n)
        return sorted([f[i] for i in f])
    def a046523(n):
        x=1
        while True:
            if P(n) == P(x): return x
            else: x+=1
    def a278223(n): return a046523(2*n - 1)
    def T(n, m): return ((n + m)**2 - n - 3*m + 2)/2
    def a049084(n): return primepi(n) if isprime(n) else 0
    def a112046(n):
        i=1
        while True:
            if J(i, 2*n + 1)!=1: return i
            else: i+=1
    def a112049(n): return a049084(a112046(n))
    def a(n): return 1 if n==1 else T(a112049(n - 1), a278223(n)) # Indranil Ghosh, May 11 2017
  • Scheme
    (define (A286465 n) (if (= 1 n) n (* (/ 1 2) (+ (expt (+ (A112049 (- n 1)) (A046523 (+ -1 n n))) 2) (- (A112049 (- n 1))) (- (* 3 (A046523 (+ -1 n n)))) 2))))
    

Formula

a(1) = 1; for n > 1, a(n) = (1/2)*(2 + ((A112049(n-1)+A046523((2*n)-1))^2) - A112049(n-1) - 3*A046523((2*n)-1)).
Showing 1-10 of 20 results. Next