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 10 results.

A305801 Lexicographically earliest infinite sequence such that a(i) = a(j) => f(i) = f(j), where f(n) = 0 if n is an odd prime, with f(n) = n for all other n.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Jun 14 2018

Keywords

Comments

The original name was: "Filter sequence for a(odd prime) = constant sequences", which stemmed from the fact that for all i, j, a(i) = a(j) => b(i) = b(j) for any sequence b that obtains a constant value for all odd primes A065091.
For example, we have for all i, j:
a(i) = a(j) => A305800(i) = A305800(j),
a(i) = a(j) => A007814(i) = A007814(j),
a(i) = a(j) => A305891(i) = A305891(j) => A291761(i) = A291761(j).
There are several filter sequences "above" this one (meaning that they have finer equivalence class partitioning), for example, we have, for all i, j:
[where odd primes are further distinguished by]
A305900(i) = A305900(j) => a(i) = a(j), [whether p = 3 or > 3]
A319350(i) = A319350(j) => a(i) = a(j), [A007733(p)]
A319704(i) = A319704(j) => a(i) = a(j), [p mod 4]
A319705(i) = A319705(j) => a(i) = a(j), [A286622(p)]
A331304(i) = A331304(j) => a(i) = a(j), [parity of A000720(p)]
A336855(i) = A336855(j) => a(i) = a(j). [distance to the next larger prime]

Crossrefs

Cf. A305900, A319350, A319704, A319705, A331304, A336855 (sequences with finer equivalence class partitioning).
Cf. also A003602, A103391, A295300, A305795, A324400, A331300, A336460 (for similar constructions or similarly useful sequences).

Programs

  • Mathematica
    Array[If[# <= 2, #, If[PrimeQ[#], 3, 2 + # - PrimePi[#]]] &, 105] (* Michael De Vlieger, Oct 18 2021 *)
  • PARI
    A305801(n) = if(n<=2,n,if(isprime(n),3,2+n-primepi(n)));

Formula

a(1) = 1, a(2) = 2; for n > 2, a(n) = 3 for odd primes, and a(n) = 2+n-A000720(n) for composite n.
For n > 2, a(n) = 1 + A305800(n).

Extensions

Name changed and Comment section rewritten by Antti Karttunen, Oct 17 2021

A323172 Denominator of the average of distinct prime factors of n (A008472(n)/A001221(n)).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Jan 05 2019

Keywords

Crossrefs

Cf. A323171 (numerators).

Programs

  • Mathematica
    a[n_] := Denominator[Mean[FactorInteger[n][[;; , 1]]]]; Array[a, 100, 2] (* Amiram Eldar, Sep 17 2024 *)
  • PARI
    A008472(n) = vecsum(factor(n)[, 1]); \\ From A008472
    A323172(n) = (denominator(A008472(n)/omega(n)));

A322587 Lexicographically earliest such sequence a that for all i, j, a(i) = a(j) => f(i) = f(j), where f(n) = 0 for odd primes, and f(n) = A291756(n) [equally: A295887(n)] for any other number.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Dec 18 2018

Keywords

Comments

For all i, j: a(i) = a(j) => A322320(i) = A322320(j).

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; };
    A003557(n) = { my(f=factor(n)); for(i=1, #f~, f[i, 2] = f[i, 2]-1); factorback(f); };
    A173557(n) = my(f=factor(n)[, 1]); prod(k=1, #f, f[k]-1); \\ From A173557
    Aux322587(n) = if((n>2)&&isprime(n),0,(1/2)*(2 + ((A003557(n)+A173557(n))^2) - A003557(n) - 3*A173557(n)));
    v322587 = rgs_transform(vector(up_to, n, Aux322587(n)));
    A322587(n) = v322587[n];

A322588 Lexicographically earliest such sequence a that for all i, j, a(i) = a(j) => f(i) = f(j), where f(n) = 0 for odd primes, and f(n) = A291750(n) for any other number.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Dec 18 2018

Keywords

Comments

For all i, j: a(i) = a(j) => A322318(i) = A322318(j).

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; };
    A003557(n) = { my(f=factor(n)); for(i=1, #f~, f[i, 2] = f[i, 2]-1); factorback(f); };
    A048250(n) = factorback(apply(p -> p+1,factor(n)[,1]));
    Aux322588(n) = if((n>2)&&isprime(n),0,(1/2)*(2 + ((A003557(n)+A048250(n))^2) - A003557(n) - 3*A048250(n)));
    v322588 = rgs_transform(vector(up_to, n, Aux322588(n)));
    A322588(n) = v322588[n];

A367095 Number of distinct sums of pairs (repeats allowed) of prime indices of n.

Original entry on oeis.org

0, 1, 1, 1, 1, 3, 1, 1, 1, 3, 1, 3, 1, 3, 3, 1, 1, 3, 1, 3, 3, 3, 1, 3, 1, 3, 1, 3, 1, 5, 1, 1, 3, 3, 3, 3, 1, 3, 3, 3, 1, 6, 1, 3, 3, 3, 1, 3, 1, 3, 3, 3, 1, 3, 3, 3, 3, 3, 1, 5, 1, 3, 3, 1, 3, 6, 1, 3, 3, 6, 1, 3, 1, 3, 3, 3, 3, 6, 1, 3, 1, 3, 1, 6, 3, 3, 3, 3, 1, 5, 3, 3, 3, 3, 3, 3, 1, 3, 3, 3, 1, 6, 1, 3, 5
Offset: 1

Views

Author

Gus Wiseman, Nov 06 2023

Keywords

Comments

A prime index of n is a number m such that prime(m) divides n. The multiset of prime indices of n is row n of A112798.
Is the image missing only 2 and 4?

Examples

			The prime indices of 15 are {2,3}, with sums of pairs:
  2+2 = 4
  2+3 = 5
  3+3 = 6
so a(15) = 3.
The prime indices of 180 are {1,1,2,2,3}, with sums of pairs:
  1+1 = 2
  1+2 = 3
  1+3 = 4
  2+2 = 4
  2+3 = 5
  3+3 = 6
so a(180) = 5.
		

Crossrefs

Depends only on squarefree kernel A007947. (Even more exactly, on A322591 - Antti Karttunen, Jan 20 2025)
Positions of first appearances appear to be a subset of A325986.
For 2-element submultisets we have A366739, for all submultisets A299701.
A001222 counts prime factors (also indices), distinct A001221.
A001358 lists semiprimes, squarefree A006881, conjugate A065119.
A056239 adds up prime indices, row sums of A112798.
A304793 counts positive subset-sums of prime indices.
A367096 lists semiprime divisors, count A086971.

Programs

  • Mathematica
    prix[n_]:=If[n==1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
    Table[Length[Union[Total/@Tuples[prix[n],2]]],{n,100}]
  • PARI
    A367095(n) = if(1==n, 0, my(pis=apply(primepi,factor(n)[,1]), pairsums = vector(binomial(1+#pis,2)), k=0); for(i=1,#pis,for(j=i,#pis,k++; pairsums[k] = pis[i]+pis[j])); #Set(pairsums)); \\ Antti Karttunen, Jan 20 2025

Extensions

Data section extended to a(105) by Antti Karttunen, Jan 20 2025

A322592 Lexicographically earliest such sequence a that for all i, j, a(i) = a(j) => f(i) = f(j), where f(n) = 0 for odd primes, and f(n) = A289625(n) for any other number.

Original entry on oeis.org

1, 1, 2, 3, 2, 3, 2, 4, 5, 6, 2, 4, 2, 5, 7, 7, 2, 5, 2, 7, 8, 9, 2, 10, 11, 12, 13, 8, 2, 7, 2, 14, 15, 16, 17, 8, 2, 13, 17, 18, 2, 8, 2, 15, 17, 19, 2, 18, 20, 11, 21, 17, 2, 13, 22, 23, 24, 25, 2, 18, 2, 26, 27, 21, 28, 15, 2, 21, 29, 17, 2, 23, 2, 30, 22, 24, 31, 17, 2, 32, 33, 34, 2, 23, 35, 20, 36, 37, 2, 17, 38, 29, 31, 39, 40, 41, 2, 20, 31, 22, 2, 21, 2, 42, 42
Offset: 1

Views

Author

Antti Karttunen, Dec 18 2018

Keywords

Comments

For all i, j:
a(i) = a(j) => A034380(i) = A034380(j),
a(i) = a(j) => A104194(i) = A104194(j),
a(i) = a(j) => A290084(i) = A290084(j).

Crossrefs

Programs

  • PARI
    default(parisizemax,2^31);
    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; };
    A289625(n) = { my(m=1,p=2,v=znstar(n)[2]); for(i=1,length(v),m *= p^v[i]; p = nextprime(p+1)); (m); };
    Aux322592(n) = if((n>2)&&isprime(n),0,A289625(n));
    v322592 = rgs_transform(vector(up_to, n, Aux322592(n)));
    A322592(n) = v322592[n];
    for(n=1,up_to,write("b322592.txt", n, " ", A322592(n)));

A324401 Lexicographically earliest sequence such that a(i) = a(j) => f(i) = f(j) for all i, j >= 1, where f(n) = -1 if n is an odd prime, f(n) = -2 if n = 2^k, with k > 1, and f(n) = n for all other numbers.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Mar 01 2019

Keywords

Comments

For all i, j:
A305801(i) = A305801(j) => a(i) = a(j),
a(i) = a(j) => A305976(i) = A305976(j) => A001221(i) = A001221(j),
a(i) = a(j) => A322591(i) = A322591(j),
a(i) = a(j) => A323235(i) = A323235(j),
a(i) = a(j) => A324399(i) = A324399(j),
a(i) = a(j) => A297159(i) = A297159(j).

Crossrefs

Programs

  • PARI
    A000523(n) = if(n<1, 0, #binary(n)-1);
    A324401(n) = if(n<4,n,if(isprime(n),3,if(!bitand(n,n-1),4,4+n-A000523(n)-primepi(n))));
    
  • 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; };
    Aux324401(n) = if((n>2) && (isprime(n)||!bitand(n,n-1)),-(2-(n%2)),n);
    \\ Equally: Aux324401(n) = if(n<=2,n,if(isprime(n),-1,if(!bitand(n,n-1),-2,n)));
    v324401 = rgs_transform(vector(up_to, n, Aux324401(n)));
    A324401(n) = v324401[n];

Formula

If n <= 2, a(n) = n, for n > 2, if n is an odd prime, a(n) = 3, if n = 2^k, with k >= 2, a(n) = 4, otherwise a(n) = 4 + n - A000523(n) - A000720(n).

A322589 Lexicographically earliest such sequence a that for all i, j, a(i) = a(j) => f(i) = f(j), where f(n) = 0 for odd primes, and f(n) = A007913(n) for any other number.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Dec 18 2018

Keywords

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; };
    Aux322589(n) = if((n>2)&&isprime(n),0,core(n));
    v322589 = rgs_transform(vector(up_to, n, Aux322589(n)));
    A322589(n) = v322589[n];

A322809 Lexicographically earliest such sequence a that a(i) = a(j) => f(i) = f(j) for all i, j, where f(n) = -1 if n is an odd prime, and f(n) = floor(n/2) for all other numbers.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Dec 26 2018

Keywords

Comments

This sequence is a restricted growth sequence transform of a function f which is defined as f(n) = A004526(n), unless n is an odd prime, in which case f(n) = -1, which is a constant not in range of A004526. See the Crossrefs section for a list of similar sequences.
For all i, j:
A305801(i) = A305801(j) => a(i) = a(j),
a(i) = a(j) => A039636(i) = A039636(j).
For all i, j: a(i) = a(j) <=> A323161(i+1) = A323161(j+1).
The shifted version of this filter, A323161, has a remarkable ability to find many sequences related to primes and prime chains. - Antti Karttunen, Jan 06 2019

Crossrefs

A list of few similarly constructed sequences follows, where each sequence is an rgs-transform of such function f, for which the value of f(n) is the n-th term of the sequence whose A-number follows after a parenthesis, unless n is of the form ..., in which case f(n) is given a constant value outside of the range of that sequence:
A322809 (A004526, unless an odd prime) [This sequence],
A322589 (A007913, unless an odd prime),
A322591 (A007947, unless an odd prime),
A322805 (A252463, unless an odd prime),
A323082 (A300840, unless an odd prime),
A322822 (A300840, unless n > 2 and a Fermi-Dirac prime, A050376),
A322988 (A322990, unless a prime power > 2),
A323078 (A097246, unless an odd prime),
A322808 (A097246, unless a squarefree number > 2),
A322816 (A048675, unless an odd prime),
A322807 (A285330, unless an odd prime),
A322814 (A286621, unless an odd prime),
A322824 (A242424, unless an odd prime),
A322973 (A006370, unless an odd prime),
A322974 (A049820, unless n > 1 and n is in A046642),
A323079 (A060681, unless an odd prime),
A322587 (A295887, unless an odd prime),
A322588 (A291751, unless an odd prime),
A322592 (A289625, unless an odd prime),
A323369 (A323368, unless an odd prime),
A323371 (A295886, unless an odd prime),
A323374 (A323373, unless an odd prime),
A323401 (A323372, unless an odd prime),
A323405 (A323404, unless an odd prime).

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; };
    A322809aux(n) = if((n>2)&&isprime(n),-1,(n>>1));
    v322809 = rgs_transform(vector(up_to,n,A322809aux(n)));
    A322809(n) = v322809[n];

Formula

a(n) = A323161(n+1) - 1.

A340679 If n is a power of prime then a(n) = 1, otherwise a(n) = product of the distinct prime factors of n.

Original entry on oeis.org

1, 1, 1, 1, 1, 6, 1, 1, 1, 10, 1, 6, 1, 14, 15, 1, 1, 6, 1, 10, 21, 22, 1, 6, 1, 26, 1, 14, 1, 30, 1, 1, 33, 34, 35, 6, 1, 38, 39, 10, 1, 42, 1, 22, 15, 46, 1, 6, 1, 10, 51, 26, 1, 6, 55, 14, 57, 58, 1, 30, 1, 62, 21, 1, 65, 66, 1, 34, 69, 70, 1, 6, 1, 74, 15, 38, 77, 78, 1, 10, 1, 82, 1, 42, 85, 86, 87, 22, 1, 30, 91, 46
Offset: 1

Views

Author

Antti Karttunen, Feb 01 2021

Keywords

Crossrefs

Cf. A000961 (positions of ones), A007947, A010055, A014963.
Cf. also A048671, A322591.

Programs

  • Mathematica
    Table[If[PrimePowerQ[n],1,Times@@FactorInteger[n][[All,1]]],{n,100}] (* Harvey P. Dale, May 23 2021 *)
  • PARI
    A340679(n) = if(isprimepower(n),1,factorback(factorint(n)[, 1]));

Formula

If A010055(n) == 1 [when n is a power of prime], a(n) = 1, otherwise a(n) = A007947(n).
a(n) = A007947(n) / A014963(n).
Showing 1-10 of 10 results.