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

A300229 Restricted growth sequence transform of A285729, combining A032742(n) and A046523(n), the largest proper divisor and the prime signature of n.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Mar 01 2018

Keywords

Examples

			a(10) = a(15) (= 7) because both are nonsquare semiprimes (2*5 and 3*5), and when the smallest prime factor is divided out, both yield the same quotient, 5.
		

Crossrefs

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])); }
    A032742(n) = if(1==n,n,n/vecmin(factor(n)[,1]));
    A046523(n) = { my(f=vecsort(factor(n)[, 2], , 4), p); prod(i=1, #f, (p=nextprime(p+1))^f[i]); };  \\ From A046523
    A285729(n) = (1/2)*(2 + ((A032742(n)+A046523(n))^2) - A032742(n) - 3*A046523(n));
    write_to_bfile(1,rgs_transform(vector(65537,n,A285729(n))),"b300229.txt");

A286472 Compound filter (for counting prime gaps): a(1) = 1, a(n) = 2*A032742(n) + (1 if n is composite and spf(A032742(n)) > nextprime(spf(n)), and 0 otherwise). Here spf is the smallest prime factor, A020639.

Original entry on oeis.org

1, 2, 2, 4, 2, 6, 2, 8, 6, 11, 2, 12, 2, 15, 10, 16, 2, 18, 2, 20, 15, 23, 2, 24, 10, 27, 18, 28, 2, 30, 2, 32, 23, 35, 14, 36, 2, 39, 27, 40, 2, 42, 2, 44, 30, 47, 2, 48, 14, 51, 35, 52, 2, 54, 23, 56, 39, 59, 2, 60, 2, 63, 42, 64, 27, 66, 2, 68, 47, 71, 2, 72, 2, 75, 50, 76, 22, 78, 2
Offset: 1

Views

Author

Antti Karttunen, May 11 2017

Keywords

Comments

For n > 1, a(n) is odd if and only if n is a composite with its smallest prime factor occurring only once and with a gap of at least one between the smallest and the next smallest prime factor.
For all i, j: a(i) = a(j) => A073490(i) = A073490(j). This follows because A073490(n) can be computed by recursively invoking a(n), without needing any other information.

Examples

			For n = 4 = 2*2, the two smallest prime factors (taken with multiplicity) are 2 and 2, and the difference between their indices is 0, thus a(4) = 2*A032742(4) + 0 = 2*(4/2) + 0 = 2.
For n = 6 = 2*3 = prime(1)*prime(2), the difference between the indices of two smallest prime factors is 1 (which is less than required 2), thus a(6) = 2*A032742(6) + 0 = 2*(6/2) + 0 = 6.
For n = 10 = 2*5 = prime(1)*prime(3), the difference between the indices of two smallest prime factors is 2, thus a(10) = 2*A032742(10) + 1 = 2*(10/2) + 1 = 11.
		

Crossrefs

Cf. A000040 (primes give the positions of 2's).
Cf. A073490 (one of the matched sequences).

Programs

  • Mathematica
    Table[Function[{p, d}, 2 d + If[And[CompositeQ@ n, FactorInteger[d][[1, 1]] > NextPrime[p]], 1, 0] - Boole[n == 1]] @@ {#, n/#} &@ FactorInteger[n][[1, 1]], {n, 98}] (* Michael De Vlieger, May 12 2017 *)
  • Python
    from sympy import primefactors, divisors, nextprime
    def ok(n): return 1 if isprime(n)==0 and min(primefactors(divisors(n)[-2])) > nextprime(min(primefactors(n))) else 0
    def a(n): return 1 if n==1 else 2*divisors(n)[-2] + ok(n) # Indranil Ghosh, May 12 2017
  • Scheme
    (define (A286472 n) (if (= 1 n) n (+ (* 2 (A032742 n)) (if (> (A286471 n) 2) 1 0))))
    

Formula

a(n) = 2*A032742(n) + [A286471(n) > 2], a(1) = 1.

A286473 Compound filter (for counting primes of form 4k+1, 4k+2 and 4k+3): a(n) = 4*A032742(n) + (A020639(n) mod 4), a(1) = 1.

Original entry on oeis.org

1, 6, 7, 10, 5, 14, 7, 18, 15, 22, 7, 26, 5, 30, 23, 34, 5, 38, 7, 42, 31, 46, 7, 50, 21, 54, 39, 58, 5, 62, 7, 66, 47, 70, 29, 74, 5, 78, 55, 82, 5, 86, 7, 90, 63, 94, 7, 98, 31, 102, 71, 106, 5, 110, 45, 114, 79, 118, 7, 122, 5, 126, 87, 130, 53, 134, 7, 138, 95, 142, 7, 146, 5, 150, 103, 154, 47, 158, 7, 162, 111, 166, 7, 170, 69, 174, 119, 178, 5, 182, 55
Offset: 1

Views

Author

Antti Karttunen, May 11 2017

Keywords

Comments

For all i, j: a(i) = a(j) => A079635(i) = A079635(j). This follows because A079635(n) can be computed by recursively invoking a(n), without needing any other information.

Crossrefs

Cf. A001511, A007814, A065339, A079635, A083025 (some of the matched sequences).

Programs

  • Mathematica
    With[{k = 4}, Table[Function[{p, d}, k d + Mod[p, k] - k Boole[n == 1]] @@ {#, n/#} &@ FactorInteger[n][[1, 1]], {n, 91}]] (* Michael De Vlieger, May 12 2017 *)
  • Python
    from sympy import divisors, primefactors
    def a(n): return 1 if n==1 else 4*divisors(n)[-2] + (min(primefactors(n))%4) # Indranil Ghosh, May 12 2017
  • Scheme
    (define (A286473 n) (if (= 1 n) n (+ (* 4 (A032742 n)) (modulo (A020639 n) 4))))
    

Formula

a(1) = 1, for n > 1, a(n) = 4*A032742(n) + (A020639(n) mod 4).

A286474 Compound filter: a(n) = 4*A032742(n) + (n mod 4), a(1) = 1.

Original entry on oeis.org

1, 6, 7, 8, 5, 14, 7, 16, 13, 22, 7, 24, 5, 30, 23, 32, 5, 38, 7, 40, 29, 46, 7, 48, 21, 54, 39, 56, 5, 62, 7, 64, 45, 70, 31, 72, 5, 78, 55, 80, 5, 86, 7, 88, 61, 94, 7, 96, 29, 102, 71, 104, 5, 110, 47, 112, 77, 118, 7, 120, 5, 126, 87, 128, 53, 134, 7, 136, 93, 142, 7, 144, 5, 150, 103, 152, 45, 158, 7, 160, 109, 166, 7, 168, 69, 174, 119, 176, 5, 182, 55
Offset: 1

Views

Author

Antti Karttunen, May 11 2017

Keywords

Crossrefs

Programs

  • Mathematica
    Table[If[n == 1, 1, 4 (Divisors[n][[-2]]) + Mod[n, 4]], {n, 91}] (* Michael De Vlieger, May 12 2017 *)
  • Python
    from sympy import divisors, primefactors
    def a(n): return 1 if n==1 else 4*divisors(n)[-2] + n%4 # Indranil Ghosh, May 12 2017
  • Scheme
    (define (A286474 n) (if (= 1 n) n (+ (* 4 (A032742 n)) (modulo n 4))))
    

Formula

a(1) = 1, for n > 1, a(n) = 4*A032742(n) + (n mod 4).

A286476 Compound filter: a(n) = 6*A032742(n) + (n mod 6), a(1) = 1.

Original entry on oeis.org

1, 8, 9, 16, 11, 18, 7, 26, 21, 34, 11, 36, 7, 44, 33, 52, 11, 54, 7, 62, 45, 70, 11, 72, 31, 80, 57, 88, 11, 90, 7, 98, 69, 106, 47, 108, 7, 116, 81, 124, 11, 126, 7, 134, 93, 142, 11, 144, 43, 152, 105, 160, 11, 162, 67, 170, 117, 178, 11, 180, 7, 188, 129, 196, 83, 198, 7, 206, 141, 214, 11, 216, 7, 224, 153, 232, 71, 234, 7, 242, 165, 250, 11, 252, 103
Offset: 1

Views

Author

Antti Karttunen, May 11 2017

Keywords

Crossrefs

Programs

  • Mathematica
    With[{k = 6}, Table[If[n == 1, 1, k (Divisors[n][[-2]]) + Mod[n, k]], {n, 85}]] (* Michael De Vlieger, May 12 2017 *)
  • Python
    from sympy import divisors
    def a(n): return 1 if n==1 else 6*divisors(n)[-2] + n%6 # Indranil Ghosh, May 12 2017
  • Scheme
    (define (A286476 n) (if (= 1 n) n (+ (* 6 (A032742 n)) (modulo n 6))))
    

Formula

a(1) = 1, for n > 1, a(n) = 6*A032742(n) + (n mod 6).

A286152 Compound filter: a(n) = T(A051953(n), A046523(n)), where T(n,k) is sequence A000027 used as a pairing function.

Original entry on oeis.org

0, 2, 2, 12, 2, 40, 2, 59, 18, 61, 2, 179, 2, 86, 73, 261, 2, 265, 2, 265, 100, 148, 2, 757, 33, 185, 129, 367, 2, 1297, 2, 1097, 166, 271, 131, 1735, 2, 320, 205, 1105, 2, 1741, 2, 619, 517, 430, 2, 3113, 52, 850, 295, 769, 2, 1747, 205, 1517, 346, 625, 2, 5297, 2, 698, 730, 4497, 248, 2821, 2, 1117, 460, 2821, 2, 7069, 2, 941, 1070, 1315, 248, 3457, 2, 4513
Offset: 1

Views

Author

Antti Karttunen, May 04 2017

Keywords

Crossrefs

Programs

  • Mathematica
    Table[(2 + (#1 + #2)^2 - #1 - 3 #2)/2 & @@ {n - EulerPhi@ n, Times @@ MapIndexed[Prime[First@ #2]^#1 &, Sort[FactorInteger[n][[All, -1]], Greater]] - Boole[n == 1]}, {n, 80}] (* Michael De Vlieger, May 04 2017 *)
  • PARI
    A051953(n) = (n - eulerphi(n));
    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
    A286152(n) = (2 + ((A051953(n)+A046523(n))^2) - A051953(n) - 3*A046523(n))/2;
    for(n=1, 10000, write("b286152.txt", n, " ", A286152(n)));
    
  • Python
    from sympy import factorint, totient
    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(n - totient(n), a046523(n)) # Indranil Ghosh, May 05 2017
  • Scheme
    (define (A286152 n) (* (/ 1 2) (+ (expt (+ (A051953 n) (A046523 n)) 2) (- (A051953 n)) (- (* 3 (A046523 n))) 2)))
    

Formula

a(n) = (1/2)*(2 + ((A051953(n)+A046523(n))^2) - A051953(n) - 3*A046523(n)).

A286475 Compound filter (for counting primes of form 6k+1, 6k+2, 6k+3 and 6k+5): a(n) = 6*A032742(n) + (A020639(n) mod 6), a(1) = 1.

Original entry on oeis.org

1, 8, 9, 14, 11, 20, 7, 26, 21, 32, 11, 38, 7, 44, 33, 50, 11, 56, 7, 62, 45, 68, 11, 74, 35, 80, 57, 86, 11, 92, 7, 98, 69, 104, 47, 110, 7, 116, 81, 122, 11, 128, 7, 134, 93, 140, 11, 146, 43, 152, 105, 158, 11, 164, 71, 170, 117, 176, 11, 182, 7, 188, 129, 194, 83, 200, 7, 206, 141, 212, 11, 218, 7, 224, 153, 230, 67, 236, 7, 242, 165, 248, 11, 254, 107
Offset: 1

Views

Author

Antti Karttunen, May 11 2017

Keywords

Examples

			For n = 55 = 5*11, a(n) = 6*A032742(55) + (5 modulo 6) = 6*11 + 5 = 71.
For n = 121 = 11*11, a(n) = 6*A032742(121) + (11 modulo 6) = 6*11 + 1 = 71.
For n = 91 = 7*13, a(n) = 6*A032742(91) + (7 modulo 6) = 6*13 + 1 = 79.
For n = 169 = 13*13, a(n) = 6*A032742(169) + (13 modulo 6) = 6*13 + 1 = 79.
		

Crossrefs

Programs

  • Mathematica
    With[{k = 6}, Table[Function[{p, d}, k d + Mod[p, k] - k Boole[n == 1]] @@ {#, n/#} &@ FactorInteger[n][[1, 1]], {n, 85}]] (* Michael De Vlieger, May 12 2017 *)
  • Python
    from sympy import divisors, primefactors
    def a(n): return 1 if n==1 else 6*divisors(n)[-2] +(min(primefactors(n))%6) # Indranil Ghosh, May 12 2017
  • Scheme
    (define (A286475 n) (if (= 1 n) n (+ (* 6 (A032742 n)) (modulo (A020639 n) 6))))
    

Formula

a(1) = 1, for n > 1, a(n) = 6*A032742(n) + (A020639(n) mod 6).

A286149 Compound filter: a(n) = T(A046523(n), A109395(n)), where T(n,k) is sequence A000027 used as a pairing function.

Original entry on oeis.org

1, 5, 8, 14, 17, 34, 30, 44, 19, 51, 68, 103, 93, 72, 196, 152, 155, 103, 192, 132, 72, 126, 278, 349, 32, 159, 53, 165, 437, 976, 498, 560, 709, 237, 786, 739, 705, 282, 159, 402, 863, 660, 948, 243, 337, 384, 1130, 1273, 49, 132, 1546, 288, 1433, 349, 126, 459, 282, 567, 1772, 2761, 1893, 636, 165, 2144, 2421, 1921, 2280, 390, 2707, 2046, 2558, 2773, 2703
Offset: 1

Views

Author

Antti Karttunen, May 04 2017

Keywords

Crossrefs

Programs

  • Mathematica
    Table[(2 + (#1 + #2)^2 - #1 - 3 #2)/2 & @@ {Times @@ MapIndexed[ Prime[First@ #2]^#1 &, Sort[FactorInteger[n][[All, -1]], Greater]] - Boole[n == 1], Denominator[EulerPhi[n]/n]}, {n, 73}] (* Michael De Vlieger, May 04 2017 *)
  • PARI
    A109395(n) = n/gcd(n, eulerphi(n));
    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
    A286149(n) = (1/2)*(2 + ((A046523(n)+A109395(n))^2) - A046523(n) - 3*A109395(n));
    for(n=1, 10000, write("b286149.txt", n, " ", A286149(n)));
    
  • Python
    from sympy import factorint, totient, gcd
    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), n/gcd(n, totient(n))) # Indranil Ghosh, May 05 2017
  • Scheme
    (define (A286149 n) (* (/ 1 2) (+ (expt (+ (A046523 n) (A109395 n)) 2) (- (A046523 n)) (- (* 3 (A109395 n))) 2)))
    

Formula

a(n) = (1/2)*(2 + ((A046523(n)+A109395(n))^2) - A046523(n) - 3*A109395(n)).

A286379 Compound filter ("discard the smallest prime factor" & "signature for 1-runs in base-2"): a(n) = P(A032742(n), A278222(n)), where P(n,k) is sequence A000027 used as a pairing function, with a(1) = 1.

Original entry on oeis.org

1, 2, 7, 5, 16, 18, 29, 14, 31, 50, 67, 42, 67, 98, 195, 44, 16, 100, 67, 115, 637, 242, 277, 117, 125, 289, 955, 224, 277, 450, 497, 152, 131, 248, 160, 271, 436, 454, 643, 320, 436, 1246, 1771, 550, 2716, 1058, 1129, 375, 160, 655, 1343, 692, 1771, 1918, 3332, 623, 880, 1355, 2557, 1020, 1129, 1922, 3507, 560, 166, 736, 67, 775, 1349, 1070, 277, 856, 436
Offset: 1

Views

Author

Antti Karttunen, May 13 2017

Keywords

Crossrefs

Programs

  • PARI
    A032742(n) = if(1==n,n,n/vecmin(factor(n)[,1]));
    A005940(n) = { my(p=2, t=1); n--; until(!n\=2, if((n%2), (t*=p), p=nextprime(p+1))); t }; \\ Modified from code of M. F. Hasler
    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
    A278222(n) = A046523(A005940(1+n));
    A286379(n) = if(1==n,n,(1/2)*(2 + ((A032742(n)+A278222(n))^2) - A032742(n) - 3*A278222(n)));
    for(n=1, 16384, write("b286379.txt", n, " ", A286379(n)));
    
  • Python
    from sympy import factorint, divisors
    import math
    def T(n, m): return ((n + m)**2 - n - 3*m + 2)/2
    def A(n): return n - 2**int(math.floor(math.log(n, 2)))
    def b(n): return n + 1 if n<2 else prime(1 + (len(bin(n)[2:]) - bin(n)[2:].count("1"))) * b(A(n))
    def a005940(n): return b(n - 1)
    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 a278222(n): return a046523(a005940(n + 1))
    def a(n): return 1 if n==1 else T(divisors(n)[-2], a278222(n)) # Indranil Ghosh, May 13 2017
  • Scheme
    (define (A286379 n) (if (= 1 n) n (* (/ 1 2) (+ (expt (+ (A032742 n) (A278222 n)) 2) (- (A032742 n)) (- (* 3 (A278222 n))) 2))))
    

Formula

a(1) = 1, for n > 1, a(n) = (1/2)*(2 + ((A032742(n)+A278222(n))^2) - A032742(n) - 3*A278222(n)).
Showing 1-9 of 9 results.