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-7 of 7 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

A286622 Restricted growth sequence computed for filter-sequence A278222, related to 1-runs in the binary representation of n.

Original entry on oeis.org

1, 2, 2, 3, 2, 4, 3, 5, 2, 4, 4, 6, 3, 6, 5, 7, 2, 4, 4, 6, 4, 8, 6, 9, 3, 6, 6, 10, 5, 9, 7, 11, 2, 4, 4, 6, 4, 8, 6, 9, 4, 8, 8, 12, 6, 12, 9, 13, 3, 6, 6, 10, 6, 12, 10, 14, 5, 9, 9, 14, 7, 13, 11, 15, 2, 4, 4, 6, 4, 8, 6, 9, 4, 8, 8, 12, 6, 12, 9, 13, 4, 8, 8, 12, 8, 16, 12, 17, 6, 12, 12, 18, 9, 17, 13, 19, 3, 6, 6, 10, 6, 12, 10, 14, 6, 12, 12, 18, 10, 18
Offset: 0

Views

Author

Antti Karttunen, May 11 2017

Keywords

Comments

When filtering sequences (by equivalence class partitioning), this sequence can be used instead of A278222, because for all i, j it holds that: a(i) = a(j) <=> A278222(i) = A278222(j).
For example, for all i, j: a(i) = a(j) => A000120(i) = A000120(j), and for all i, j: a(i) = a(j) => A001316(i) = A001316(j).
The sequence allots a distinct value for each distinct multiset formed from the lengths of 1-runs in the binary representation of n. See the examples. - Antti Karttunen, Jun 04 2017

Examples

			For n = 0, there are no 1-runs, thus the multiset is empty [], and it is allotted the number 1, thus a(0) = 1.
For n = 1, in binary also "1", there is one 1-run of length 1, thus the multiset is [1], which has not been encountered before, and a new number is allotted for that, thus a(1) = 2.
For n = 2, in binary "10", there is one 1-run of length 1, thus the multiset is [1], which was already encountered at n=1, thus a(2) = a(1) = 2.
For n = 3, in binary "11", there is one 1-run of length 2, thus the multiset is [2], which has not been encountered before, and a new number is allotted for that, thus a(3) = 3.
For n = 4, in binary "100", there is one 1-run of length 1, thus the multiset is [1], which was already encountered at n=1 for the first time, thus a(4) = a(1) = 2.
For n = 5, in binary "101", there are two 1-runs, both of length 1, thus the multiset is [1,1], which has not been encountered before, and a new number is allotted for that, thus a(5) = 4.
		

Crossrefs

Cf. A286552 (ordinal transform).
Cf. also A101296, A286581, A286589, A286597, A286599, A286600, A286602, A286603, A286605, A286610, A286619, A286621, A286626, A286378, A304101 for similarly constructed or related sequences.
Cf. also A305793, A305795.

Programs

  • PARI
    rgs_transform(invec) = { my(occurrences = Map(), outvec = vector(length(invec)), u=1); for(i=1, length(invec), if(mapisdefined(occurrences,invec[i]), my(pp = mapget(occurrences, invec[i])); outvec[i] = outvec[pp] , mapput(occurrences,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])); }
    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));
    v286622 = rgs_transform(vector(1+65537, n, A278222(n-1)));
    A286622(n) = v286622[1+n];

Extensions

Example section added by Antti Karttunen, Jun 04 2017

A305793 Restricted growth sequence transform of A305792, a filter sequence constructed from binary expansions of the proper divisors of n.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Jun 11 2018

Keywords

Crossrefs

Programs

  • PARI
    \\ Needs also code from A286622:
    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; };
    A305792(n) = { my(m=1); fordiv(n,d,if(dA286622(d)-1))); (m); };
    v305793 = rgs_transform(vector(up_to, n, A305792(n)));
    A305793(n) = v305793[n];

Formula

For all i, j:
a(i) = a(j) => A000005(i) = A000005(j).
a(i) = a(j) => A292257(i) = A292257(j).
a(i) = a(j) => A305426(i) = A305426(j).
a(i) = a(j) => A305435(i) = A305435(j).

A305815 Restricted growth sequence transform of A305814, a filter sequence constructed from the GF(2)[X]-factorization signatures of the divisors of n.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Jun 11 2018

Keywords

Crossrefs

Programs

  • PARI
    \\ Needs also code from A305788:
    up_to = 65537;
    rgs_transform(invec) = { my(occurrences = Map(), outvec = vector(length(invec)), u=1); for(i=1, length(invec), if(mapisdefined(occurrences,invec[i]), my(pp = mapget(occurrences, invec[i])); outvec[i] = outvec[pp] , mapput(occurrences,invec[i],i); outvec[i] = u; u++ )); outvec; };
    A305814(n) = { my(m=1); fordiv(n, d, if(d>1, m *= prime(A305788(d)-1))); (m); };
    v305815 = rgs_transform(vector(up_to, n, A305814(n)));
    A305815(n) = v305815[n];

Formula

For all i, j:
a(i) = a(j) => A000005(i) = A000005(j).
a(i) = a(j) => A294883(i) = A294883(j).
a(i) = a(j) => A294884(i) = A294884(j).

A317945 Filter sequence constructed from the coefficients of the Stern polynomials B(d,t) collected for each divisor d of n. Restricted growth sequence transform of A317944.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Aug 12 2018

Keywords

Comments

Differs from A000027(n) = n (positive integers) from a(193) = 191 on.
For all i, j: a(i) = a(j) => A317838(i) = A317838(j).
There are certain prime pairs p, q for which the Stern polynomials B(p,t) and B(q,t) (see table A125184) have equal multisets of nonzero coefficients. For example, for primes 191 and 193 these coefficients are {1, 2, 2, 2, 2, 3, 1} and {1, 2, 2, 2, 3, 2, 1} (from which follows that A278243(191) = A278243(193), A286378(191) = A286378(193) and thus => a(191) = a(193) => A002487(191) = A002487(193) as well). Other such prime pairs currently known are {419, 461}, {2083, 2143} and {11777, 12799}. Whenever a(p) = a(q) for such a prime pair, then also a(2^k * p) = a(2^k * q) for all k >= 0. It would be nice to know whether there could exist any other cases of a(i) = a(j), i != j, but for example both i and j being odd semiprimes?

Crossrefs

Programs

  • PARI
    \\ Needs also code from A286378.
    up_to = 65537;
    A317944(n) = { my(m=1); fordiv(n,d, if(d>1, m *= prime(A286378(d)-1))); (m); };
    v317945 = rgs_transform(vector(up_to, n, A317944(n)));
    A317945(n) = v317945[n];

A305794 a(n) = Product_{d|n, d>1} prime(A286622(d)-1).

Original entry on oeis.org

1, 2, 3, 4, 5, 18, 7, 8, 15, 50, 11, 108, 11, 98, 195, 16, 5, 450, 11, 500, 357, 242, 19, 648, 55, 242, 345, 1372, 19, 76050, 29, 32, 165, 50, 385, 13500, 17, 242, 627, 5000, 17, 254898, 31, 5324, 30225, 722, 37, 3888, 77, 6050, 345, 5324, 31, 238050, 2255, 19208, 627, 722, 41, 29659500, 37, 1682, 76755, 64, 275, 54450, 11, 500, 969, 296450, 19, 405000, 17
Offset: 1

Views

Author

Antti Karttunen, Jun 11 2018

Keywords

Crossrefs

Cf. A008578, A278222, A286622, A305792, A305795 (rgs-transform).
Cf. also A304104.

Programs

  • PARI
    A305794(n) = { my(m=1); fordiv(n, d, if(d>1, m *= prime(A286622(d)-1))); (m); }; \\ Needs also code from A286622.

Formula

a(n) = Product_{d|n, d>1} A008578(A286622(d)).
For all k >= 0, a(2^k) = 2^k.

A319705 Filter sequence which for primes p records a distinct value for each distinct multiset formed from the lengths of 1-runs in its binary representation [A286622(p)], and for all other numbers assigns a unique number.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Sep 26 2018

Keywords

Comments

Restricted growth sequence transform of function f defined as f(n) = A278222(n) when n is a prime, otherwise -n.
After its initial term 3, Fermat primes (A019434) gives the positions of 5 in this sequence, while the Mersenne primes (A000668) are each assigned to their own singleton equivalence class.
For all i, j:
a(i) = a(j) => A305900(i) = A305900(j),
a(i) = a(j) => A286622(i) = A286622(j),
a(i) = a(j) => A305795(i) = A305795(j).

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; };
    A005940(n) = { my(p=2, t=1); n--; until(!n\=2, if((n%2), (t*=p), p=nextprime(p+1))); t };
    A046523(n) = { my(f=vecsort(factor(n)[, 2], , 4), p); prod(i=1, #f, (p=nextprime(p+1))^f[i]); };  \\ From A046523
    A278222(n) = A046523(A005940(1+n));
    A319705aux(n) = if(isprime(n),A278222(n),-n);
    v319705 = rgs_transform(vector(up_to,n,A319705aux(n)));
    A319705(n) = v319705[n];
Showing 1-7 of 7 results.