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.

A322988 Lexicographically earliest such sequence a that a(i) = a(j) => f(i) = f(j) for all i, j, where f(1) = 0 if n is a prime power > 2, f(2) = -1, and f(n) = A322990(n) for all other numbers.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Jan 02 2019

Keywords

Comments

For all i, j: a(i) = a(j) => A322989(i) = A322989(j).
For all i, j > 2: A305976(i) = A305976(j) => a(i) = a(j).

Crossrefs

Cf. A322805, A322822 for analogous constructions for filter sequences.

Programs

  • PARI
    up_to = 8192;
    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; };
    A289271(n) = { my(v=0,i=0,x=1); for(d=2,oo,if(n==1, return(v)); if(1==gcd(x,d)&&1==omega(d), if(!(n%d)&&1==gcd(d,n/d), v += 2^i; n /= d; x *= d); i++)); }; \\ After Rémy Sigrist's program for A289271.
    A289272(n) = { my(m=1, pp=1); while(n>0, pp++; while(!isprimepower(pp)||(gcd(pp,m)>1), pp++); if(n%2, m *= pp); n >>=1); (m); }; \\ Antti Karttunen, Jan 02 2019
    A322990(n) = A289272(A289271(n)>>1);
    A322988aux(n) = if(2==n,-1,if(isprimepower(n),0,A322990(n)));
    v322988 = rgs_transform(vector(up_to,n,A322988aux(n)));
    A322988(n) = v322988[n];

A322989 If n is a power of a prime, then a(n) = 0, otherwise a(n) = 1 + a(A322990(n)).

Original entry on oeis.org

0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2, 0, 1, 2, 0, 0, 1, 0, 3, 2, 1, 0, 2, 0, 1, 0, 3, 0, 2, 0, 0, 2, 1, 4, 3, 0, 1, 2, 4, 0, 2, 0, 3, 4, 1, 0, 2, 0, 1, 2, 3, 0, 1, 4, 5, 2, 1, 0, 3, 0, 1, 5, 0, 4, 2, 0, 3, 2, 3, 0, 6, 0, 1, 2, 3, 5, 2, 0, 4, 0, 1, 0, 3, 4, 1, 2, 6, 0, 3, 5, 3, 2, 1, 4, 2, 0, 1, 7, 3, 0, 2, 0, 6, 4
Offset: 1

Views

Author

Antti Karttunen, Jan 01 2019

Keywords

Comments

For n > 1, a(n) gives the number of edges needed from n to the leftmost branch (where the terms of A000961 are located) in the binary tree illustrated in A289272.

Crossrefs

Programs

  • PARI
    A289271(n) = { my(v=0,i=0,x=1); for(d=2,oo,if(n==1, return(v)); if(1==gcd(x,d)&&1==omega(d), if(!(n%d)&&1==gcd(d,n/d), v += 2^i; n /= d; x *= d); i++)); }; \\ After Rémy Sigrist's program for A289271.
    A289272(n) = { my(m=1, pp=1); while(n>0, pp++; while(!isprimepower(pp)||(gcd(pp,m)>1), pp++); if(n%2, m *= pp); n >>=1); (m); };
    A322989(n) = if((1==n)||isprimepower(n),0,1+A322989(A322990(n)));
    A322990(n) = A289272(A289271(n)>>1);

Formula

If A001221(n) <= 1 [when n is in A000961], then a(n) = 0, otherwise a(n) = 1 + a(A322990(n)).

A289271 A bijective binary representation of the prime factorization of a number, shown in decimal (see Comments for precise definition).

Original entry on oeis.org

0, 1, 2, 4, 8, 3, 16, 32, 64, 5, 128, 6, 256, 9, 10, 512, 1024, 17, 2048, 12, 18, 33, 4096, 34, 8192, 65, 16384, 20, 32768, 7, 65536, 131072, 66, 129, 24, 36, 262144, 257, 130, 40, 524288, 11, 1048576, 68, 72, 513, 2097152, 258, 4194304, 1025, 514, 132
Offset: 1

Views

Author

Rémy Sigrist, Jun 30 2017

Keywords

Comments

For n > 0, with prime factorization Product_{i=1..k} p_i ^ e_i (all p_i distinct and all e_i > 0):
- let S_n = A000961 \ { p_i ^ (e_i + j) with i=1..k and j > 0 },
- a(n) = Sum_{i=1..k} 2^#{ s in S_n with 1 < s < p_i ^ e_i }.
In an informal way, we encode the prime powers > 1 that are unitary divisors of n as 1's in binary, while discarding the 0's corresponding to their "proper" multiples.
a(A002110(n)) = 2^n-1 for any n >= 0.
a(A000961(n+1)) = 2^(n-1) for any n > 0.
A000120(a(n)) = A001221(n) for any n > 0 (each prime divisor p of n (alongside the p-adic valuation of n) is encoded as a single 1 bit in the base-2 representation of a(n)).
A000961(2+A007814(a(n))) = A034684(n) for any n > 1 (the least significant bit of a(n) encodes the smallest unitary divisor of n that is larger than 1).
This sequence establishes a bijection between the positive numbers and the nonnegative numbers; see A289272 for the inverse of this sequence.
The numbers 4, 36, 40 and 532 equal their image; are there other such numbers?
This sequence has connections with A034729 (which encodes the divisors of a number, and is not surjective) and A087207 (which encodes the prime divisors of a number, and is not injective).

Examples

			For n = 204 = 2^2 * 3 * 17:
- S_204 = A000961 \ { 2^3, 2^4, ..., 3^2, ... }
        = { 1, 2, 3, 4, 5, 7, 11, 13, 17, ... },
- a(204) = 2^#{ 2, 3 } + 2^#{ 2 } + 2^#{ 2, 3, 4, 5, 7, 11, 13 }
         = 2^2 + 2^1 + 2^7
         = 134.
See also the illustration of the first terms in Links section.
		

Crossrefs

Cf. also A156552, A052331 for similar constructions.

Programs

  • PARI
    See Links section.
    
  • PARI
    A289271(n) = { my(f = factor(n), pps = vecsort(vector(#f~, i, f[i, 1]^f[i, 2])), s=0, x=1, pp=1, k=-1); for(i=1,#f~, while(pp < pps[i], pp++; while(!isprimepower(pp)||(gcd(pp,x)>1), pp++); k++); s += 2^k; x *= pp); (s); }; \\ Antti Karttunen, Jan 01 2019

A289272 Inverse to A289271.

Original entry on oeis.org

1, 2, 3, 6, 4, 10, 12, 30, 5, 14, 15, 42, 20, 70, 60, 210, 7, 18, 21, 66, 28, 90, 84, 330, 35, 126, 105, 462, 140, 630, 420, 2310, 8, 22, 24, 78, 36, 110, 132, 390, 40, 154, 120, 546, 180, 770, 660, 2730, 56, 198, 168, 858, 252, 990, 924, 4290, 280, 1386, 840
Offset: 0

Views

Author

Rémy Sigrist, Jun 30 2017

Keywords

Comments

a(2^n-1) = A002110(n) for any n >= 0.
a(2^(n-1)) = A000961(n+1) for any n > 0.
A001221(a(n)) = A000120(n) for any n >= 0.
From Antti Karttunen, Jan 01 2019: (Start)
A034684(a(n)) = A000961(1+A001511(n)) for any n >= 1. (See also Rémy Sigrist's comment in A289271).
This sequence can be regarded also as an irregular triangle with rows of lengths 1, 1, 2, 4, 8, 16, ..., that is, it can be represented as a binary tree, where each left hand child contains A322991(k), and each right hand child contains A322992(k), when their parent contains k:
1
|
...................2...................
3 6
4......../ \........10 12......../ \........30
/ \ / \ / \ / \
/ \ / \ / \ / \
/ \ / \ / \ / \
5 14 15 42 20 70 60 210
7 18 21 66 28 90 84 330 35 126 105 462 140 630 420 2310
etc.
The leftmost edge is A000961, the next lefmost is A278568 (after 2: 6, 10, 14, 18, ...), the righmost edge is A002110, the next rightmost A088860 but with 3 instead of 4.
Compare also to trees like A005940 (A163511) and A052330.
(End)

Examples

			A289271(1) = 0, hence a(0) = 1.
A289271(2) = 1, hence a(1) = 2.
A289271(3) = 2, hence a(2) = 3.
A289271(4) = 4, hence a(4) = 4.
A289271(5) = 8, hence a(8) = 5.
A289271(6) = 3, hence a(3) = 6.
A289271(7) = 16, hence a(16) = 7.
A289271(8) = 32, hence a(32) = 8.
A289271(9) = 64, hence a(64) = 9.
A289271(10) = 5, hence a(5) = 10.
		

Crossrefs

Programs

  • PARI
    See Links section.
    
  • PARI
    A289272(n) = { my(m=1, pp=1); while(n>0, pp++; while(!isprimepower(pp)||(gcd(pp,m)>1), pp++); if(n%2, m *= pp); n >>=1); (m); }; \\ Antti Karttunen, Jan 01 2019

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.

A322991 a(n) = A289272(2*A289271(n)).

Original entry on oeis.org

1, 3, 4, 5, 7, 12, 8, 9, 11, 15, 13, 20, 16, 21, 28, 17, 19, 24, 23, 35, 36, 33, 25, 44, 27, 39, 29, 40, 31, 60, 32, 37, 52, 48, 56, 45, 41, 51, 68, 63, 43, 84, 47, 55, 77, 57, 49, 76, 53, 69, 92, 65, 59, 75, 91, 72, 100, 87, 61, 140, 64, 93, 88, 67, 112, 132, 71, 80, 108, 105, 73, 99, 79, 96, 116, 85, 104, 156, 81, 119, 83, 111, 89
Offset: 1

Views

Author

Antti Karttunen, Jan 01 2019

Keywords

Crossrefs

Permutation of A042965 (apart from zero).
Cf. also A003963, A300841.

Programs

  • PARI
    A289271(n) = { my(v=0,i=0,x=1); for(d=2,oo,if(n==1, return(v)); if(1==gcd(x,d)&&1==omega(d), if(!(n%d)&&1==gcd(d,n/d), v += 2^i; n /= d; x *= d); i++)); }; \\ After Rémy Sigrist's program for A289271.
    A289272(n) = { my(m=1, pp=1); while(n>0, pp++; while(!isprimepower(pp)||(gcd(pp,m)>1), pp++); if(n%2, m *= pp); n >>=1); (m); };
    A322991(n) = A289272(2*A289271(n));

Formula

a(n) = A289272(2*A289271(n)).

A322992 a(n) = A289272(1+(2*A289271(n))).

Original entry on oeis.org

2, 6, 10, 14, 18, 30, 22, 26, 34, 42, 38, 70, 46, 66, 90, 50, 54, 78, 58, 126, 110, 102, 62, 130, 74, 114, 82, 154, 86, 210, 94, 98, 170, 138, 198, 182, 106, 150, 190, 234, 118, 330, 122, 238, 306, 174, 134, 230, 142, 186, 270, 266, 146, 222, 342, 286, 290, 246, 158, 630, 162, 258, 374, 166, 414, 390, 178, 322, 310, 462, 194, 442, 202
Offset: 1

Views

Author

Antti Karttunen, Jan 01 2019

Keywords

Crossrefs

Permutation of A016825.

Programs

  • PARI
    A322992(n) = A289272(1+(2*A289271(n)));
    A289271(n) = { my(v=0,i=0,x=1); for(d=2,oo,if(n==1, return(v)); if(1==gcd(x,d)&&1==omega(d), if(!(n%d)&&1==gcd(d,n/d), v += 2^i; n /= d; x *= d); i++)); }; \\ After Rémy Sigrist's program for A289271.
    A289272(n) = { my(m=1, pp=1); while(n>0, pp++; while(!isprimepower(pp)||(gcd(pp,m)>1), pp++); if(n%2, m *= pp); n >>=1); (m); };

Formula

a(n) = A289272(1+(2*A289271(n))).
Showing 1-7 of 7 results.