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

A286386 Compound filter: a(n) = 2*A286473(n) + (1 if n is a square, 0 otherwise).

Original entry on oeis.org

3, 12, 14, 21, 10, 28, 14, 36, 31, 44, 14, 52, 10, 60, 46, 69, 10, 76, 14, 84, 62, 92, 14, 100, 43, 108, 78, 116, 10, 124, 14, 132, 94, 140, 58, 149, 10, 156, 110, 164, 10, 172, 14, 180, 126, 188, 14, 196, 63, 204, 142, 212, 10, 220, 90, 228, 158, 236, 14, 244, 10, 252, 174, 261, 106, 268, 14, 276, 190, 284, 14, 292, 10, 300, 206, 308, 94, 316, 14, 324, 223
Offset: 1

Views

Author

Antti Karttunen, May 13 2017

Keywords

Crossrefs

Cf. A000290 (gives the positions off odd terms), A010052, A286473, A286366, A286388.

Programs

  • Python
    from sympy import sqrt, divisors, primefactors
    import math
    def a010052(n): return 1 if n<1 else int(math.floor(sqrt(n))) - int(math.floor(sqrt(n - 1)))
    def a286473(n): return 1 if n==1 else 4*divisors(n)[-2] + (min(primefactors(n))%4)
    def a(n): return 2*a286473(n) + a010052(n) # Indranil Ghosh, May 14 2017
  • Scheme
    (define (A286386 n) (+ (* 2 (A286473 n)) (A010052 n)))
    

Formula

a(n) = 2*A286473(n) + A010052(n).

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.

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

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

A319714 Filter sequence combining the largest proper divisor of n (A032742) with n's residue modulo 4 (A010873).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Sep 26 2018

Keywords

Comments

Restricted growth sequence transform of A286474, or equally, of A286473.

Crossrefs

Programs

  • PARI
    up_to = 100000;
    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; };
    A032742(n) = if(1==n,n,n/vecmin(factor(n)[,1]));
    A286474(n) = if(1==n,n,(4*A032742(n) + (n % 4)));
    v319714 = rgs_transform(vector(up_to,n,A286474(n)));
    A319714(n) = v319714[n];
Showing 1-6 of 6 results.