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.

Previous Showing 81-90 of 118 results. Next

A246682 Permutation of natural numbers: a(1) = 0, a(2) = 1, and for n > 1, a(2n) = nthcomposite(a(n)), a(2n-1) = nthprime(a(A064989(2n-1))), where nthprime = A000040, nthcomposite = A002808, and A064989(n) shifts the prime factorization of n one step towards smaller primes.

Original entry on oeis.org

0, 1, 2, 4, 3, 6, 5, 9, 7, 8, 11, 12, 31, 10, 13, 16, 127, 14, 709, 15, 19, 20, 5381, 21, 17, 46, 23, 18, 52711, 22, 648391, 26, 29, 166, 41, 24, 9737333, 858, 71, 25, 174440041, 30, 3657500101, 32, 37, 6186
Offset: 1

Views

Author

Antti Karttunen, Sep 01 2014

Keywords

Comments

Note the indexing: the domain starts from 1, while the range includes also zero.
Has an infinite number of infinite cycles. See comments at A246681.

Crossrefs

Inverse: A246681.
Similar or related permutations: A246376, A246378, A243071, A246368, A064216, A246380.

Programs

Formula

a(1) = 0, a(2) = 1, and for n > 1, a(2n) = nthcomposite(a(n)), a(2n-1) = nthprime(a(A064989(2n-1))), where nthprime = A000040, nthcomposite = A002808, and A064989(n) shifts the prime factorization of n one step towards smaller primes.
As a composition of related permutations:
a(n) = A246378(A243071(n)).
Other identities.
For all n >= 1 the following holds:
a(A000040(n)) = A007097(n-1). [Maps primes to the iterates of primes].
A049076(a(A000040(n))) = n. [Follows from above].
For all n > 1 the following holds:
A010051(a(n)) = A000035(n). [Maps odd numbers larger than one to primes, and even numbers to composites, in some order. Permutations A246378 & A246380 have the same property].

A249825 Permutation of natural numbers: a(n) = A246277(A084968(n)).

Original entry on oeis.org

1, 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 4, 41, 43, 47, 53, 59, 61, 6, 67, 71, 73, 10, 79, 83, 89, 97, 101, 103, 14, 9, 107, 109, 22, 113, 127, 15, 131, 137, 139, 26, 149, 151, 25, 157, 163, 167, 21, 173, 179, 181, 191, 34, 33, 193, 38, 35, 197, 199, 211, 223, 227, 229, 55, 233, 39, 239, 46, 241, 251, 257, 263, 269, 271, 58, 49
Offset: 1

Views

Author

Antti Karttunen, Dec 06 2014

Keywords

Crossrefs

Programs

Formula

a(n) = A246277(A084968(n)).
As a composition of other permutations:
a(n) = A249823(A250475(n)).
a(n) = A064216(A249745(A250475(n))). [Composition of the first three rows of array A251721.]

A253894 a(1) = 1, for n > 1, a(n) = 1 + a(A253889(n)).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Jan 22 2015

Keywords

Crossrefs

One more than A253893.
Sum of A254044 and A254045.

Formula

a(1) = 1, for n > 1, a(n) = 1 + a(A253889(n)).
a(n) = A070939(A064216(n)). [Binary width of terms of A064216.]
a(n) = A253893(n) + 1.
a(n) = A254044(n) + A254045(n).

A254044 a(1) = 1, for n>1: a(n) = a(A253889(n)) + (1 if n is of the form 3n or 3n+1, otherwise 0).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Jan 23 2015

Keywords

Crossrefs

Positions of ones: A007051.

Formula

a(1) = 1, for n>1: a(n) = a(A253889(n)) + [n is of the form 3n or 3n+1, i.e., in A032766] (Here [ ] is Iverson bracket).
a(1) = 0, thereafter, if n = 3k+2, then a(n) = a((n+1)/3), otherwise a(n) = 1 + a(A253889(n)).
a(n) = A000120(A064216(n)). [Binary weight of terms of A064216.]
a(n) = A253894(n) - A254045(n).
Other identities:
a(A007051(n)) = 1 for all n >= 0. [And no 1's in any other positions.]

A254045 a(1) = 0, for n > 1: a(n) = a(A253889(n)) + floor((n modulo 3)/2).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Jan 23 2015

Keywords

Crossrefs

Formula

a(1) = 0, for n > 1: a(n) = a(A253889(n)) + floor((n modulo 3)/2).
a(1) = 0, thereafter, if n = 3k+2, then a(3k+2) = 1 + a(k+1), otherwise a(n) = a(A253889(n)).
a(n) = A080791(A064216(n)). [Number of nonleading zeros in binary representation of terms of A064216.]
a(n) = A253894(n) - A254044(n).
Other identities and observations:
a(A007051(n)) = n for all n >= 0.
a(n) >= A253786(n) for all n >= 1.

A254052 Inverse permutation to A254051.

Original entry on oeis.org

1, 3, 2, 4, 6, 7, 11, 5, 16, 22, 8, 29, 37, 10, 46, 56, 12, 67, 79, 17, 92, 106, 9, 121, 137, 23, 154, 172, 30, 191, 211, 13, 232, 254, 38, 277, 301, 47, 326, 352, 15, 379, 407, 57, 436, 466, 68, 497, 529, 18, 562, 596, 80, 631, 667, 93, 704, 742, 24, 781, 821, 107, 862, 904, 122, 947, 991, 14, 1036, 1082, 138, 1129, 1177, 155, 1226, 1276, 31
Offset: 1

Views

Author

Antti Karttunen, Jan 24 2015

Keywords

Crossrefs

Inverse: A254051.
Related permutations: A064216, A254054.

Programs

  • Scheme
    (define (A254052 n) (let ((x (A254046 n)) (y (A253887 n))) (* (/ 1 2) (- (expt (+ x y) 2) x y y y -2))))

Formula

As a composition of other permutations:
a(n) = A254054(A064216(n)).

A266416 Permutation of natural numbers: a(n) = A064989(A263273(A250469(n))).

Original entry on oeis.org

1, 2, 5, 4, 3, 10, 17, 6, 13, 8, 11, 34, 9, 22, 71, 20, 7, 18, 19, 14, 23, 12, 21, 38, 41, 26, 53, 16, 31, 42, 29, 62, 107, 68, 67, 142, 61, 58, 197, 44, 25, 122, 59, 50, 137, 40, 73, 118, 49, 82, 227, 36, 33, 146, 55, 46, 89, 28, 43, 66, 37, 86, 91, 24, 45, 106, 35, 74, 65, 76, 15, 70, 47, 30, 119, 52
Offset: 1

Views

Author

Antti Karttunen, Jan 02 2016

Keywords

Crossrefs

Inverse: A266415.
Related permutations: A064216, A250471, A264985, A264996, A266403, A266645.

Programs

Formula

a(n) = A064989(A263273(A250469(n))).
As a composition of related permutations:
a(n) = A266645(A266403(n)).
a(n) = A064216(A264996(A250471(n))) = A064216(1+A264985(-1+A250471(n))).
Other identities. For all n >= 0:
A000035(a(n)) = A000035(n). [This permutation preserves the parity of n.]

A270434 a(n) = A270432(n) - A270433(n).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Mar 17 2016

Keywords

Comments

The first negative term occurs at a(223) = -1.
After a(2457) = -1 the sequence dips next time to the negative side at n=218351.
No other negative terms after a(2346395) = -1 in range 1 .. 2^25.
In range 1..(2^25) the maximum value is a(23963418) = 8326 and there are 1252224 negative terms in that range (less than 4%).

Crossrefs

Cf. A270435 (positions of zeros).
Cf. also A038698, A269364.

Programs

  • Mathematica
    nn = 200; f[n_] := (Times @@ Power[If[# == 1, 1, NextPrime@ #] & /@ First@ #, Last@ #] + 1)/2 &@ Transpose@ FactorInteger@ n; g[n_] := Times @@ Power[If[# == 1, 1, NextPrime[#, -1]] & /@ First@ #, Last@ #] &@ Transpose@ FactorInteger[2 n - 1]; s = Select[Range@ nn, Xor[EvenQ@ f@ #, OddQ@ g@ #] &]; t = Select[Range@ nn, Xor[EvenQ@ f@ #, EvenQ@ g@ #] &]; Table[Count[s, k_ /; k <= n] - Count[t, k_ /; k <= n], {n, nn/2}] (* Michael De Vlieger, Mar 17 2016 *)
  • PARI
    default(primelimit, 2^30);
    A003961(n) = my(f = factor(n)); for (i=1, #f~, f[i, 1] = nextprime(f[i, 1]+1)); factorback(f); \\ From Michel Marcus
    A048673(n) = (A003961(n)+1)/2;
    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)};
    A064216(n) = A064989((2*n)-1);
    t=0; for(n=1,2^25,if(!((A048673(n)+A064216(n))%2),t++,t--);write("b270434.txt", n, " ", t));
    
  • Scheme
    (define (A270434 n) (- (A270432 n) (A270433 n)))

Formula

a(n) = A270432(n) - A270433(n).

A292246 Base-2 expansion of a(n) encodes the steps where numbers of the form 3k+2 are encountered when map x -> A253889(x) is iterated down to 1, starting from x=n.

Original entry on oeis.org

0, 1, 0, 2, 3, 0, 4, 1, 2, 14, 5, 12, 6, 7, 8, 2, 1, 0, 0, 9, 26, 22, 3, 20, 6, 5, 16, 10, 29, 10, 4, 11, 30, 2, 25, 60, 56, 13, 28, 54, 15, 48, 24, 17, 44, 8, 5, 12, 38, 3, 30, 26, 1, 24, 20, 1, 18, 6, 19, 62, 14, 53, 4, 14, 45, 0, 42, 7, 124, 118, 41, 50, 58, 13, 116, 106, 11, 40, 104, 33, 32, 98, 21, 92, 6, 59, 88, 18, 21, 82, 76, 9, 34, 36, 23, 74
Offset: 1

Views

Author

Antti Karttunen, Sep 15 2017

Keywords

Examples

			For n = 2, the starting value is of the form 3k+2, after which follows A253889(3) = 1, the end point of iteration, which is not, thus a(2) = 1*(2^0) = 1.
For n = 4, the starting value is not of the form 3k+2, while A253889(4) = 2 is, thus a(4) = 0*(2^0) + 1*(2^1) = 2.
		

Crossrefs

Programs

  • Mathematica
    f[n_] := Times @@ Power[If[# == 1, 1, NextPrime[#, -1]] & /@ First@ #, Last@ #] &@ Transpose@ FactorInteger[2 n - 1]; g[n_] := (Times @@ Power[If[# == 1, 1, NextPrime@ #] & /@ First@ #, Last@ #] + 1)/2 &@ Transpose@ FactorInteger@ n; Map[FromDigits[#, 2] &[IntegerDigits[#, 3] /. d_ /; d > 0 :> d - 1] &, Array[a, 96]] (* Michael De Vlieger, Sep 16 2017 *)

Formula

a(1) = 0; for n > 1, a(n) = 2*a(A253889(n)) + floor((n mod 3)/2).
a(n) = A289814(A292243(n)).
A000120(a(n)) = A254045(n).
a(n) AND A292244(n) = a(n) AND A292245(n) = 0, where AND is a bitwise-AND (A004198).

A305901 Filter sequence for all such sequences b, for which b(A006254(k)) = constant for all k >= 3.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Jun 14 2018

Keywords

Comments

Restricted growth sequence transform of A305900(A064216(n)).
For all i, j:
a(i) = a(j) => A278223(i) = A278223(j).
a(i) = a(j) => A253786(i) = A253786(j).

Crossrefs

Cf. also A305902.

Programs

  • PARI
    up_to = 1000;
    partialsums(f,up_to) = { my(v = vector(up_to), s=0); for(i=1,up_to,s += f(i); v[i] = s); (v); }
    v_partsums = partialsums(x -> isprime(x+x-1), up_to);
    A305901(n) = if(n<=3,n,if(isprime(n+n-1),4,3+n-v_partsums[n]));

Formula

For n <= 3, a(n) = n, and for n >= 4, a(n) = 4 if 2n-1 is a prime (for all n in A006254[3..] = 4, 6, 7, 9, 10, 12, 15, ...), and for all other n (numbers n such that 2n-1 is composite), a(n) = running count from 5 onward.
Previous Showing 81-90 of 118 results. Next