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

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)).

A291769 Restricted growth sequence transform of A292249; filter combining multiplicative order of 2 mod 2n+1 & prime signature of 2n+1 (A002326 & A278223).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Oct 02 2017

Keywords

Comments

Also restricted growth sequence transform of the odd bisection of A286573.

Crossrefs

Cf. A291766, A292267 for related filters.

Programs

  • PARI
    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; };
    write_to_bfile(start_offset,vec,bfilename) = { for(n=1, length(vec), write(bfilename, (n+start_offset)-1, " ", vec[n])); }
    A002326(n) = if(n<0, 0, znorder(Mod(2, 2*n+1))); \\ This function from Michael Somos, Mar 31 2005
    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
    A292249(n) = (1/2)*(2 + ((A002326(n)+A046523(n+n+1))^2) - A002326(n) - 3*A046523(n+n+1));
    write_to_bfile(0,rgs_transform(vector(32769,n,A292249(n-1))),"b291769_upto32768.txt");

A286250 Filter-sequence: a(n) = A278223(A064216(n)) = A046523((2*A064216(n))-1).

Original entry on oeis.org

1, 2, 2, 4, 2, 2, 6, 2, 4, 6, 2, 2, 2, 6, 12, 6, 8, 2, 2, 2, 2, 16, 2, 6, 4, 6, 6, 2, 2, 30, 12, 6, 6, 4, 12, 6, 6, 6, 6, 6, 2, 2, 6, 6, 30, 2, 6, 2, 6, 6, 2, 6, 2, 6, 6, 6, 6, 2, 6, 6, 2, 12, 2, 36, 2, 6, 4, 2, 12, 30, 12, 12, 2, 12, 2, 24, 2, 2, 6, 6, 24, 2, 2, 12, 2, 24, 12, 2, 2, 30, 30, 6, 6, 2, 2, 4, 6, 2, 30, 6, 32, 2, 6, 2, 6, 2, 6, 12, 4, 2, 30, 2, 2
Offset: 1

Views

Author

Antti Karttunen, May 07 2017

Keywords

Crossrefs

Programs

  • PARI
    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
    A064989(n) = {my(f); f = factor(n); if((n>1 && f[1,1]==2), f[1,2] = 0); for (i=1, #f~, f[i,1] = precprime(f[i,1]-1)); factorback(f)};
    A064216(n) = A064989((2*n)-1);
    A286250(n) = A046523(-1+(2*A064216(n)));
    for(n=1, 10000, write("b286250.txt", n, " ", A286250(n)));
    
  • Python
    from sympy import factorint, prevprime
    from operator import mul
    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 a064216(n):
        f=factorint(2*n - 1)
        return 1 if n==1 else reduce(mul, [prevprime(i)**f[i] for i in f])
    def a(n): return a046523((2*a064216(n)) - 1) # Indranil Ghosh, May 13 2017
  • Scheme
    (define (A286250 n) (A046523 (+ -1 (* 2 (A064216 n)))))
    

Formula

a(n) = A046523(A245448(n)) = A278223(A064216(n)) = A046523((2*A064216(n))-1).

A278224 a(n) = A046523(A048673(n)).

Original entry on oeis.org

1, 2, 2, 2, 4, 8, 6, 6, 2, 2, 2, 2, 4, 2, 12, 2, 6, 6, 12, 32, 12, 12, 6, 12, 4, 6, 12, 12, 16, 2, 2, 6, 6, 2, 6, 2, 6, 6, 2, 6, 6, 2, 24, 2, 24, 12, 8, 6, 2, 6, 48, 6, 30, 12, 6, 2, 6, 2, 2, 6, 6, 24, 30, 6, 60, 12, 36, 6, 2, 12, 2, 12, 24, 6, 6, 24, 72, 128, 30, 12, 2, 6, 12, 24, 2, 2, 30, 48, 4, 2, 6, 2, 6, 48, 16, 96, 6, 30, 2, 6, 12, 6, 24, 30, 2, 2, 6
Offset: 1

Views

Author

Antti Karttunen, Nov 16 2016

Keywords

Comments

This sequence works as a "sentinel" for sequence A048673 by matching to any other sequence that is obtained as f(A048673(n)), where f(n) is any function that depends only on the prime signature of n (see the index entry for "sequences computed from exponents in ..."). As of Nov 11 2016 no such sequences were present in the database.

Crossrefs

Programs

  • Python
    from sympy import factorint, nextprime
    from operator import mul
    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 a048673(n):
        f = factorint(n)
        return 1 if n==1 else (1 + reduce(mul, [nextprime(i)**f[i] for i in f]))//2
    def a(n): return a046523(a048673(n))
    print([a(n) for n in range(1, 101)]) # Indranil Ghosh, Jun 12 2017
  • Scheme
    (define (A278224 n) (A046523 (A048673 n)))
    

Formula

a(n) = A046523(A048673(n)).

A091304 a(n) = Omega(2n-1) (number of prime factors of the n-th odd number, counted with multiplicity).

Original entry on oeis.org

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

Views

Author

Andrew S. Plewe, Feb 20 2004

Keywords

Comments

Omega(n) of the odd integers follows a pattern similar to A001222, with 4 maxima instead of 2 - i.e. between 2^n and (2^(n+1) - 1) there are two numbers with exactly n factors (2^n and 2^(n-1) * 3) while the odd integers have 4 maxima (3^n, 3^(n-1) * 5, 3^(n-1) * 7, 5^2*3^(n-2)) between 3^n and 3^(n+1) - 1.

Examples

			Omega(1) = 0, Omega(9) = 2 (3 * 3 = 9), Omega (243) = 5 (3 * 3 * 3 * 3 * 3 = 243), Omega(51) = 2 (3 * 17 = 51).
For n = 92, A001222(2*92 - 1) = A001222(183) = 2 as 183 = 3*61, thus a(92) = 2. - _Antti Karttunen_, May 31 2017
		

Crossrefs

One more than A285716 (after the initial term).
Cf. A006254 (positions of ones).

Programs

  • Mathematica
    a[n_] := PrimeOmega[2*n - 1]; Array[a, 100] (* Amiram Eldar, Jul 23 2023 *)
  • PARI
    a(n) = bigomega(2*n-1) \\ Michel Marcus, Jul 26 2013, edited to reflect the changed starting offset by Antti Karttunen, May 31 2017

Formula

a(n) = Omega(2n-1). [Odd bisection of A001222.]
From Antti Karttunen, May 31 2017: (Start)
For n >= 1, a(n) = A000120(A244153(n)).
For n >= 2, a(n) = 1+A285716(n).
(End)

Extensions

Starting offset changed to 1 and the definition modified respectively. Also values of the initial term and of term a(92) (= 2, previously a(91) = 1) corrected by Antti Karttunen, May 31 2017

A286372 a(n) = A286366(A064216(n)).

Original entry on oeis.org

4, 6, 8, 13, 4, 9, 8, 11, 13, 12, 14, 8, 28, 6, 9, 13, 11, 21, 9, 11, 13, 12, 8, 8, 40, 14, 9, 65, 14, 13, 8, 13, 64, 13, 11, 8, 9, 30, 20, 12, 4, 9, 21, 11, 8, 21, 14, 20, 12, 9, 12, 13, 23, 9, 8, 11, 13, 64, 8, 84, 28, 14, 116, 12, 14, 9, 85, 11, 8, 12, 11, 65, 65, 42, 8, 13, 13, 21, 9, 11, 21, 13, 66, 8, 28, 12, 9, 49, 14, 13, 8, 11, 65, 20, 14, 13, 9, 66
Offset: 1

Views

Author

Antti Karttunen, May 09 2017

Keywords

Crossrefs

Programs

Formula

a(n) = A286366(A064216(n)).

A305973 Filter sequence for the prime signature of 2n-1.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Jun 15 2018

Keywords

Comments

Restricted growth sequence transform of A278223, the least number with the same prime signature as the n-th odd number.

Crossrefs

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; };
    A046523(n) = { my(f=vecsort(factor(n)[, 2], , 4), p); prod(i=1, #f, (p=nextprime(p+1))^f[i]); }; \\ From A046523
    v305973 = rgs_transform(vector(up_to,n,A046523(n+n-1)));
    A305973(n) = v305973[n];

A285716 a(n) = A080791(A245611(n)).

Original entry on oeis.org

0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 2, 0, 0, 1, 1, 0, 1, 0, 0, 2, 0, 1, 1, 0, 1, 1, 0, 0, 2, 1, 0, 1, 0, 0, 2, 1, 0, 3, 0, 1, 1, 0, 1, 1, 1, 0, 2, 0, 0, 2, 0, 0, 1, 0, 1, 2, 1, 1, 1, 2, 0, 1, 0, 1, 3, 0, 0, 1, 1, 1, 2, 0, 0, 2, 1, 0, 1, 1, 0, 2, 0, 1, 2, 0, 2, 1, 0, 0, 1, 1, 1, 3, 0, 0, 2, 0, 0, 1, 1, 1, 2, 1, 0, 1, 1, 1, 1, 1, 0, 3, 0, 0, 2, 0, 1, 1, 0
Offset: 1

Views

Author

Antti Karttunen, Apr 25 2017

Keywords

Crossrefs

One less than A091304 after the initial term.
Cf. A006254 (gives the positions of zeros after initial a(1)=0.)

Programs

  • Mathematica
    a[n_] := PrimeOmega[2*n - 1] - 1; a[1] = 0; Array[a, 100] (* Amiram Eldar, Jul 23 2023 *)
  • Scheme
    ;; First implementation uses memoization-macro definec:
    (definec (A285716 n) (if (<= n 2) 0 (+ (if (= 2 (modulo n 3)) 1 0) (A285716 (A285712 n)))))
    (define (A285716 n) (A080791 (A245611 n)))

Formula

a(1) = 0, a(2) = 1, for n > 2, a(n) = a(A285712(n)) + [n == 2 mod 3]. (Where [] is Iverson bracket, giving here 1 only if n is of the form 3k+2, and 0 otherwise.)
a(n) = A080791(A245611(n)).
For all n >= 2, a(n) = A091304(n)-1 = A000120(A244153(n))-1. - Antti Karttunen, May 31 2017

A305901 Filter sequence for all such sequences b, for which b(A006254(k)) = constant for all k >= 3.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Jun 14 2018

Keywords

Comments

Restricted growth sequence transform of A305900(A064216(n)).
For all i, j:
a(i) = a(j) => A278223(i) = A278223(j).
a(i) = a(j) => A253786(i) = A253786(j).

Crossrefs

Cf. also A305902.

Programs

  • PARI
    up_to = 1000;
    partialsums(f,up_to) = { my(v = vector(up_to), s=0); for(i=1,up_to,s += f(i); v[i] = s); (v); }
    v_partsums = partialsums(x -> isprime(x+x-1), up_to);
    A305901(n) = if(n<=3,n,if(isprime(n+n-1),4,3+n-v_partsums[n]));

Formula

For n <= 3, a(n) = n, and for n >= 4, a(n) = 4 if 2n-1 is a prime (for all n in A006254[3..] = 4, 6, 7, 9, 10, 12, 15, ...), and for all other n (numbers n such that 2n-1 is composite), a(n) = running count from 5 onward.

A286257 Compound filter: a(n) = P(A046523(n), A046523(2n-1)), where P(n,k) is sequence A000027 used as a pairing function.

Original entry on oeis.org

1, 5, 5, 14, 12, 27, 5, 86, 14, 27, 23, 90, 12, 84, 27, 152, 23, 148, 5, 148, 27, 27, 80, 324, 25, 61, 44, 148, 23, 495, 5, 935, 61, 27, 61, 702, 5, 142, 61, 324, 138, 495, 23, 148, 90, 61, 23, 1426, 14, 265, 27, 90, 467, 324, 27, 430, 27, 61, 80, 2140, 12, 61, 183, 2144, 61, 495, 23, 607, 27, 495, 23, 2998, 23, 142, 90, 90, 142, 625, 5, 1426, 226, 27, 467
Offset: 1

Views

Author

Antti Karttunen, May 07 2017

Keywords

Crossrefs

Cf. A005382 (gives the positions of 5's), A067756 (of 12's), A234098 (of 23's).

Programs

  • PARI
    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
    A286257(n) = (1/2)*(2 + ((A046523(n)+A046523((2*n)-1))^2) - A046523(n) - 3*A046523((2*n)-1));
    for(n=1, 10000, write("b286257.txt", n, " ", A286257(n)));
    
  • Python
    from sympy import factorint
    def T(n, m): return ((n + m)**2 - n - 3*m + 2)/2
    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 a(n): return T(a046523(n), a046523(2*n - 1)) # Indranil Ghosh, May 07 2017
  • Scheme
    (define (A286257 n) (* (/ 1 2) (+ (expt (+ (A046523 n) (A046523 (+ -1 n n))) 2) (- (A046523 n)) (- (* 3 (A046523 (+ -1 n n)))) 2)))
    

Formula

a(n) = (1/2)*(2 + ((A046523(n)+A046523((2*n)-1))^2) - A046523(n) - 3*A046523((2*n)-1)).
a(n) = (1/2)*(2 + ((A046523(n)+A278223(n))^2) - A046523(n) - 3*A278223(n)).
Showing 1-10 of 18 results. Next