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

A336312 Lexicographically earliest infinite sequence such that a(i) = a(j) => A278222(A336120(i)) = A278222(A336120(j)) for all i, j >= 1.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Jul 17 2020

Keywords

Comments

Restricted growth sequence transform of A278222(A336120(n)).
For all i, j:
a(i) = a(j) => A336121(i) = A336121(j) => A335909(i) = A335909(j).

Crossrefs

Cf. A336119 (positions of ones).

Programs

  • PARI
    up_to = 1024; \\ 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; };
    \\ Needs also code from A336124:
    A253553(n) = if(n<=2,1,my(f=factor(n), k=#f~); if(f[k,2]>1,f[k,2]--,f[k,1] = precprime(f[k,1]-1)); factorback(f));
    A336120(n) = if(1==n,0,(3==A336124(n))+(2*A336120(A253553(n))));
    A005940(n) = { my(p=2, t=1); n--; until(!n\=2, if((n%2), (t*=p), p=nextprime(p+1))); t }; \\ From A005940
    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));
    v336312 = rgs_transform(vector(up_to,n,A278222(A336120(n))));
    A336312(n) = v336312[n];

A336311 Lexicographically earliest infinite sequence such that a(i) = a(j) => A278222(A336120(i)) = A278222(A336120(j)) and A278222(A336125(i)) = A278222(A336125(j)) for all i, j >= 1.

Original entry on oeis.org

1, 2, 2, 3, 2, 3, 2, 4, 5, 3, 2, 4, 2, 3, 5, 6, 2, 7, 2, 4, 5, 3, 2, 6, 3, 3, 8, 4, 2, 7, 2, 9, 5, 3, 3, 10, 2, 3, 5, 6, 2, 7, 2, 4, 8, 3, 2, 9, 5, 4, 5, 4, 2, 11, 3, 6, 5, 3, 2, 10, 2, 3, 8, 12, 3, 7, 2, 4, 5, 4, 2, 13, 2, 3, 4, 4, 5, 7, 2, 9, 14, 3, 2, 10, 3, 3, 5, 6, 2, 11, 5, 4, 5, 3, 3, 12, 2, 7, 8, 6, 2, 7, 2, 6, 4
Offset: 1

Views

Author

Antti Karttunen, Jul 17 2020

Keywords

Comments

Restricted growth sequence transform of the ordered pair [A336312(n), A336313(n)].
For all i, j:
A305800(i) = A305800(j) => a(i) = a(j) => A001222(i) = A001222(j).

Crossrefs

Programs

  • PARI
    \\ Needs also code from A336120, A336124, A336125, etc:
    up_to = 1024;
    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 }; \\ From A005940
    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));
    Aux336311(n) = [A278222(A336120(n)),A278222(A336125(n))];
    v336311 = rgs_transform(vector(up_to,n,Aux336311(n)));
    A336311(n) = v336311[n];

A253566 Permutation of natural numbers: a(n) = A243071(A122111(n)).

Original entry on oeis.org

0, 1, 2, 3, 4, 6, 8, 7, 5, 12, 16, 14, 32, 24, 10, 15, 64, 13, 128, 28, 20, 48, 256, 30, 9, 96, 11, 56, 512, 26, 1024, 31, 40, 192, 18, 29, 2048, 384, 80, 60, 4096, 52, 8192, 112, 22, 768, 16384, 62, 17, 25, 160, 224, 32768, 27, 36, 120, 320, 1536, 65536, 58, 131072, 3072, 44, 63, 72, 104, 262144, 448, 640, 50, 524288, 61, 1048576, 6144, 21
Offset: 1

Views

Author

Antti Karttunen, Jan 03 2015

Keywords

Comments

Note the indexing: domain starts from one, while the range includes also zero. See also comments in A253564.
The a(n)-th composition in standard order (graded reverse-lexicographic, A066099) is one plus the first differences of the weakly increasing sequence of prime indices of n with 1 prepended. See formula for a simplification. The triangular form is A358169. The inverse is A253565. Not prepending 1 gives A358171. For Heinz numbers instead of standard compositions we have A325351 (without prepending A325352). - Gus Wiseman, Dec 23 2022

Examples

			From _Gus Wiseman_, Dec 23 2022: (Start)
This represents the following bijection between partitions and compositions. The reversed prime indices of n together with the a(n)-th composition in standard order are:
   1:        () -> ()
   2:       (1) -> (1)
   3:       (2) -> (2)
   4:     (1,1) -> (1,1)
   5:       (3) -> (3)
   6:     (2,1) -> (1,2)
   7:       (4) -> (4)
   8:   (1,1,1) -> (1,1,1)
   9:     (2,2) -> (2,1)
  10:     (3,1) -> (1,3)
  11:       (5) -> (5)
  12:   (2,1,1) -> (1,1,2)
  13:       (6) -> (6)
  14:     (4,1) -> (1,4)
  15:     (3,2) -> (2,2)
  16: (1,1,1,1) -> (1,1,1,1)
(End)
		

Crossrefs

Inverse: A253565.
Applying A000120 gives A001222.
A reverse version is A156552, inverse essentially A005940.
The inverse is A253565, triangular form A242628.
The triangular form is A358169.
A048793 gives partial sums of reversed standard comps, Heinz number A019565.
A066099 lists standard compositions, lengths A000120, sums A070939.
A112798 list prime indices, sum A056239.
A358134 gives partial sums of standard compositions, Heinz number A358170.

Programs

  • Mathematica
    primeMS[n_]:=If[n==1,{},Flatten[Cases[FactorInteger[n],{p_,k_}:>Table[PrimePi[p],{k}]]]];
    stcinv[q_]:=Total[2^(Accumulate[Reverse[q]])]/2;
    stcinv/@Table[Differences[Prepend[primeMS[n],1]]+1,{n,100}] (* Gus Wiseman, Dec 23 2022 *)
  • Scheme
    (define (A253566 n) (A243071 (A122111 n)))

Formula

a(n) = A243071(A122111(n)).
As a composition of other permutations:
a(n) = A054429(A253564(n)).
a(n) = A336120(n) + A336125(n). - Antti Karttunen, Jul 18 2020
If 2n = Product_{i=1..k} prime(x_i) then a(n) = Sum_{i=1..k-1} 2^(x_k-x_{k-i}+i-1). - Gus Wiseman, Dec 23 2022

A253553 a(1) = 1; for n>1, if A241917(n) = 0 [i.e., n is a term of A070003], a(n) = A052126(n), otherwise a(n) = A252462(n).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Jan 12 2015

Keywords

Comments

If the exponent of the largest prime dividing n is larger than one, subtract one from that exponent. Otherwise, shift that "lonely largest prime" one step towards smaller primes.
For any number n >= 2 in binary trees A253563 and A253565, a(n) gives the number which is the parent of n.

Crossrefs

Cf. A252464 (the number of iterations of n -> a(n) needed to reach 1 from n.)

Programs

  • PARI
    A253553(n) = if(n<=2,1,my(f=factor(n), k=#f~); if(f[k,2]>1,f[k,2]--,f[k,1] = precprime(f[k,1]-1)); factorback(f)); \\ Antti Karttunen, Jul 17 2020
    
  • Scheme
    (define (A253553 n) (cond ((<= n 1) n) ((zero? (A241917 n)) (A052126 n)) (else (A252462 n))))

Formula

a(1) = 1; for n>1, if A241917(n) = 0 [i.e., n is a term of A070003], a(n) = A052126(n), otherwise a(n) = A252462(n).
a(n) = A122111(A252463(A122111(n))). - Antti Karttunen, Jul 14 2020

A336124 a(n) = A122111(n) mod 4.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Jul 15 2020

Keywords

Crossrefs

Programs

  • PARI
    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)};
    A122111(n) = if(1==n,n,prime(bigomega(n))*A122111(A064989(n)));
    A336124(n) = (A122111(n)%4);

Formula

a(n) = A010873(A122111(n)).

A336125 a(n) = A292385(A122111(n)).

Original entry on oeis.org

0, 1, 2, 2, 4, 4, 8, 5, 5, 8, 16, 10, 32, 16, 10, 10, 64, 8, 128, 20, 20, 32, 256, 20, 8, 64, 11, 40, 512, 16, 1024, 20, 40, 128, 16, 21, 2048, 256, 80, 40, 4096, 32, 8192, 80, 22, 512, 16384, 40, 17, 17, 160, 160, 32768, 16, 32, 80, 320, 1024, 65536, 42, 131072, 2048, 44, 41, 64, 64, 262144, 320, 640, 34, 524288, 41, 1048576, 4096, 20
Offset: 1

Views

Author

Antti Karttunen, Jul 17 2020

Keywords

Crossrefs

Programs

Formula

a(1) = 0, a(2) = 1, and for n > 2, a(n) = [A122111(n) == 1 (mod 4)] + 2*a(A253553(n)).
a(n) = A292385(A122111(n)).
a(n) = A253566(n) - A336120(n).
A000120(a(n)) = A336123(n).

A336119 Numbers k such that A122111(k) [the conjugated prime factorization of k] is a square or twice a square.

Original entry on oeis.org

1, 2, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 27, 29, 31, 33, 37, 39, 41, 43, 45, 47, 49, 51, 53, 57, 59, 61, 63, 67, 69, 71, 73, 77, 79, 81, 83, 87, 89, 91, 93, 97, 99, 101, 103, 107, 109, 111, 113, 117, 119, 123, 127, 129, 131, 133, 135, 137, 139, 141, 147, 149, 151, 153, 157, 159, 161, 163, 167, 169, 171, 173
Offset: 1

Views

Author

Antti Karttunen, Jul 14 2020

Keywords

Comments

Sequence A122111(A028982(k)), k >= 1, sorted into ascending order.

Crossrefs

Cf. A000040, A066207 (subsequences), A335909 (characteristic function).
Positions of odd terms in A323173, positions of zeros in A336120 and A336121, positions of ones in A336312.

Programs

A336121 a(1) = 0, and for n > 1, a(n) = [A122111(n) == 3 (mod 4)] + a(A253553(n)).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Jul 17 2020

Keywords

Comments

Positions for the first occurrence of each n, for n >= 0, are: 1, 4, 16, 32, 144, 512, 2048, 6912, 20736, 62208, ...

Crossrefs

Cf. A336119 (positions of zeros).

Programs

  • PARI
    A253553(n) = if(n<=2,1,my(f=factor(n), k=#f~); if(f[k,2]>1,f[k,2]--,f[k,1] = precprime(f[k,1]-1)); factorback(f));
    A336121(n) = if(1==n,0,(3==A336124(n))+A336121(A253553(n)));

Formula

a(1) = 0, and for n > 1, a(n) = [A336124(n) == 3] + a(A253553(n)).
a(n) = A000120(A336120(n)).
a(n) = A292377(A122111(n)).
a(n) = A001222(n) - A336123(n).
Showing 1-8 of 8 results.